Пример #1
0
    def test_change_ttl_five_minutes(self):
        self.assertEqual(FakeDNSProvider.dns_ttl, {})
        ChangeTTLTo5Minutes(self.instance).do()

        self.assertEqual(len(FakeDNSProvider.dns_ttl), 1)
        self.assertIn(self.infra, FakeDNSProvider.dns_ttl)
        ttl_seconds = FakeDNSProvider.dns_ttl[self.infra]
        self.assertEqual(ttl_seconds, 300)
Пример #2
0
def region_migration_prepare(infra):
    instance = infra.instances.first()
    ChangeTTLTo5Minutes(instance).do()
Пример #3
0
 def test_unicode(self):
     change_ttl = ChangeTTLTo5Minutes(self.instance)
     change_ttl.minutes = randint(1, 10000)
     self.assertEqual(
         unicode(change_ttl),
         'Changing DNS TLL to {} minutes...'.format(change_ttl.minutes))
Пример #4
0
 def test_minutes_to_seconds(self):
     change_ttl = ChangeTTLTo5Minutes(self.instance)
     change_ttl.minutes = randint(1, 10000)
     self.assertEqual(change_ttl.seconds, change_ttl.minutes * 60)