1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Initial import of OSS OctoDNS

This commit is contained in:
Ross McFarland
2017-03-15 15:38:10 -07:00
parent 85e4f92d53
commit 7957a4c018
80 changed files with 15212 additions and 0 deletions

69
tests/helpers.py Normal file
View File

@@ -0,0 +1,69 @@
#
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from shutil import rmtree
from tempfile import mkdtemp
class SimpleSource(object):
def __init__(self, id='test'):
pass
class SimpleProvider(object):
SUPPORTS_GEO = False
def __init__(self, id='test'):
pass
def populate(self, zone, source=True):
pass
def supports(self, record):
return True
def __repr__(self):
return self.__class__.__name__
class GeoProvider(object):
SUPPORTS_GEO = True
def __init__(self, id='test'):
pass
def populate(self, zone, source=True):
pass
def supports(self, record):
return True
def __repr__(self):
return self.__class__.__name__
class NoSshFpProvider(SimpleProvider):
def supports(self, record):
return record._type != 'SSHFP'
class TemporaryDirectory(object):
def __init__(self, delete_on_exit=True):
self.delete_on_exit = delete_on_exit
def __enter__(self):
self.dirname = mkdtemp()
return self
def __exit__(self, *args, **kwargs):
if self.delete_on_exit:
rmtree(self.dirname)
else:
raise Exception(self.dirname)