Esempio n. 1
0
 def test_absent_zone_not_found(self):
     """
     Assert that when you try and ensure absent state for a record to a zone that doesn't exist
     it fails gracefully
     """
     result = libcloud_dns.record_absent("mail", "notatest.com", "A", "127.0.0.1", "test")
     self.assertFalse(result['result'])
Esempio n. 2
0
 def test_absent_zone_not_found(self):
     '''
     Assert that when you try and ensure absent state for a record to a zone that doesn't exist
     it fails gracefully
     '''
     result = libcloud_dns.record_absent('mail', 'notatest.com', 'A', '127.0.0.1', 'test')
     self.assertFalse(result['result'])
Esempio n. 3
0
def test_absent_record_does_not_exist():
    """
    Try and deny a record that already exists
    """
    result = libcloud_dns.record_absent("mail", "test.com", "A", "127.0.0.1",
                                        "test")
    assert result
Esempio n. 4
0
 def test_absent_record_does_not_exist(self):
     '''
     Try and deny a record that already exists
     '''
     result = libcloud_dns.record_absent('mail', 'test.com', 'A',
                                         '127.0.0.1', 'test')
     self.assertTrue(result)
Esempio n. 5
0
 def test_absent_zone_not_found(self):
     """
     Assert that when you try and ensure absent state for a record to a zone that doesn't exist
     it fails gracefully
     """
     result = libcloud_dns.record_absent("mail", "notatest.com", "A",
                                         "127.0.0.1", "test")
     self.assertFalse(result['result'])
Esempio n. 6
0
 def test_absent_record_does_not_exist(self):
     """
     Try and deny a record that already exists
     """
     with patch.object(MockDnsModule, 'delete_record') as create_patch:
         result = libcloud_dns.record_absent("mail", "test.com", "A", "127.0.0.1", "test")
         self.assertTrue(result)
     self.assertFalse(create_patch.called)
Esempio n. 7
0
 def test_absent_record_exists(self):
     """
     Try and deny a record that already exists
     """
     with patch.object(MockDnsModule, 'delete_record', MagicMock(return_value=True)) as create_patch:
         result = libcloud_dns.record_absent("www", "test.com", "A", "127.0.0.1", "test")
         self.assertTrue(result)
     create_patch.assert_called_with('zone1', 0, 'test')
Esempio n. 8
0
 def test_absent_record_does_not_exist(self):
     """
     Try and deny a record that already exists
     """
     with patch.object(MockDnsModule, 'delete_record') as create_patch:
         result = libcloud_dns.record_absent("mail", "test.com", "A",
                                             "127.0.0.1", "test")
         self.assertTrue(result)
     self.assertFalse(create_patch.called)
Esempio n. 9
0
 def test_absent_record_exists(self):
     """
     Try and deny a record that already exists
     """
     with patch.object(MockDnsModule, 'delete_record',
                       MagicMock(return_value=True)) as create_patch:
         result = libcloud_dns.record_absent("www", "test.com", "A",
                                             "127.0.0.1", "test")
         self.assertTrue(result)
     create_patch.assert_called_with('zone1', 0, 'test')
Esempio n. 10
0
 def test_absent_record_exists(self):
     """
     Try and deny a record that already exists
     """
     result = libcloud_dns.record_absent("www", "test.com", "A", "127.0.0.1", "test")
     self.assertTrue(result)