def test_0060_srv_record_without_ttl(self): host = UserHost.q.first() service = "service" priority = 10 weight = 100 port = 1010 target = "target" record = create_srv_record(priority=priority, service=service, weight=weight, port=port, target=target, host=host) self.assertEqual( SRVRecord.q.filter(SRVRecord.id == record.id).one().service, service) self.assertEqual( SRVRecord.q.filter(SRVRecord.id == record.id).one().priority, priority) self.assertEqual( SRVRecord.q.filter(SRVRecord.id == record.id).one().weight, weight) self.assertEqual( SRVRecord.q.filter(SRVRecord.id == record.id).one().port, port) self.assertEqual( SRVRecord.q.filter(SRVRecord.id == record.id).one().target, target) self.assertIsNone( SRVRecord.q.filter(SRVRecord.id == record.id).one().time_to_live) self.assertEqual( SRVRecord.q.filter(SRVRecord.id == record.id).one().host, host) delete_record(record.id)
def test_0050_ns_record_without_ttl(self): host = UserHost.q.first() domain = "domain" server = "server" record = create_ns_record(domain=domain, server=server, host=host) self.assertEqual( NSRecord.q.filter(NSRecord.id == record.id).one().domain, domain) self.assertEqual( NSRecord.q.filter(NSRecord.id == record.id).one().server, server) self.assertIsNone( NSRecord.q.filter(NSRecord.id == record.id).one().time_to_live) self.assertEqual( NSRecord.q.filter(NSRecord.id == record.id).one().host, host) delete_record(record.id)
def test_0030_cname_record(self): record_for = ARecord.q.first() host = UserHost.q.first() name = "test" record = create_cname_record(record_for=record_for, name=name, host=host) self.assertEqual( CNAMERecord.q.filter(CNAMERecord.id == record.id).one().record_for, record_for) self.assertEqual( CNAMERecord.q.filter(CNAMERecord.id == record.id).one().name, name) self.assertEqual( CNAMERecord.q.filter(CNAMERecord.id == record.id).one().host, host) delete_record(record.id)
def test_0020_aaaa_record_without_ttl(self): address = Ip.q.get(IpData.ip_v6.id) host = UserHost.q.first() name = "test" record = create_aaaa_record(address=address, name=name, host=host) self.assertEqual( AAAARecord.q.filter(AAAARecord.id == record.id).one().name, name) self.assertEqual( AAAARecord.q.filter(AAAARecord.id == record.id).one().address, address) self.assertIsNone( AAAARecord.q.filter(AAAARecord.id == record.id).one().time_to_live) self.assertEqual( AAAARecord.q.filter(AAAARecord.id == record.id).one().host, host) delete_record(record.id)
def test_0050_ns_record_without_ttl(self): host = UserHost.q.first() domain = "domain" server = "server" record = create_ns_record(domain=domain, server=server, host=host) self.assertEqual( NSRecord.q.filter(NSRecord.id == record.id).one().domain, domain) self.assertEqual( NSRecord.q.filter(NSRecord.id == record.id).one().server, server) self.assertIsNone( NSRecord.q.filter(NSRecord.id == record.id).one().time_to_live) self.assertEqual(NSRecord.q.filter(NSRecord.id == record.id).one().host, host) delete_record(record.id)
def test_0015_a_record_with_ttl(self): address = Ip.q.get(IpData.ip_v4.id) host = UserHost.q.first() name = "test" ttl = 100 record = create_a_record(address=address, name=name, time_to_live=ttl, host=host) self.assertEqual(ARecord.q.filter(ARecord.id == record.id).one().name, name) self.assertEqual( ARecord.q.filter(ARecord.id == record.id).one().address, address) self.assertEqual( ARecord.q.filter(ARecord.id == record.id).one().time_to_live, ttl) self.assertEqual(ARecord.q.filter(ARecord.id == record.id).one().host, host) delete_record(record.id)
def test_0015_a_record_with_ttl(self): address = Ip.q.get(IpData.ip_v4.id) host = UserHost.q.first() name = "test" ttl = 100 record = create_a_record(address=address, name=name, time_to_live=ttl, host=host) self.assertEqual( ARecord.q.filter(ARecord.id == record.id).one().name, name) self.assertEqual( ARecord.q.filter(ARecord.id == record.id).one().address, address) self.assertEqual( ARecord.q.filter(ARecord.id == record.id).one().time_to_live, ttl) self.assertEqual( ARecord.q.filter(ARecord.id == record.id).one().host, host) delete_record(record.id)
def test_0040_mx_record(self): host = UserHost.q.first() server = "server" domain = "domain" priority = 10 record = create_mx_record(priority=priority, server=server, domain=domain, host=host) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().server, server) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().domain, domain) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().priority, priority) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().host, host) delete_record(record.id)
def test_0040_mx_record(self): host = UserHost.q.first() server = "server" domain = "domain" priority = 10 record = create_mx_record(priority=priority, server=server, domain=domain, host=host) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().server, server) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().domain, domain) self.assertEqual( MXRecord.q.filter(MXRecord.id == record.id).one().priority, priority) self.assertEqual(MXRecord.q.filter(MXRecord.id == record.id).one().host, host) delete_record(record.id)
def test_0060_srv_record(self): record = SRVRecord.q.first() delete_record(record.id) self.assertIsNone(SRVRecord.q.filter(SRVRecord.id == record.id).first())
def test_0050_mx_record(self): record = MXRecord.q.first() delete_record(record.id) self.assertIsNone(MXRecord.q.filter(MXRecord.id == record.id).first())
def test_0040_cname_record(self): record = CNAMERecord.q.first() delete_record(record.id) self.assertIsNone( CNAMERecord.q.filter(CNAMERecord.id == record.id).first())
def test_0030_ns_record(self): record = NSRecord.q.first() delete_record(record.id) self.assertIsNone(NSRecord.q.filter(NSRecord.id == record.id).first())
def test_0020_aaaa_record(self): record = AAAARecord.q.first() delete_record(record.id) self.assertIsNone( AAAARecord.q.filter(AAAARecord.id == record.id).first())
def test_0060_srv_record(self): record = SRVRecord.q.first() delete_record(record.id) self.assertIsNone( SRVRecord.q.filter(SRVRecord.id == record.id).first())