コード例 #1
0
ファイル: libcloud_dns_test.py プロジェクト: bryson/salt
 def test_present_zone_not_found(self):
     """
     Assert that when you try and ensure present state for a record to a zone that doesn't exist
     it fails gracefully
     """
     result = libcloud_dns.record_present("mail", "notatest.com", "A", "127.0.0.1", "test")
     self.assertFalse(result['result'])
コード例 #2
0
 def test_present_zone_not_found(self):
     '''
     Assert that when you try and ensure present state for a record to a zone that doesn't exist
     it fails gracefully
     '''
     result = libcloud_dns.record_present('mail', 'notatest.com', 'A', '127.0.0.1', 'test')
     self.assertFalse(result['result'])
コード例 #3
0
def test_present_record_does_not_exist():
    """
    Try and create a record that already exists
    """
    result = libcloud_dns.record_present("mail", "test.com", "A", "127.0.0.1",
                                         "test")
    assert result
コード例 #4
0
ファイル: test_libcloud_dns.py プロジェクト: morinap/salt-1
 def test_present_record_does_not_exist(self):
     '''
     Try and create a record that already exists
     '''
     result = libcloud_dns.record_present('mail', 'test.com', 'A',
                                          '127.0.0.1', 'test')
     self.assertTrue(result)
コード例 #5
0
 def test_present_zone_not_found(self):
     """
     Assert that when you try and ensure present state for a record to a zone that doesn't exist
     it fails gracefully
     """
     result = libcloud_dns.record_present("mail", "notatest.com", "A",
                                          "127.0.0.1", "test")
     self.assertFalse(result['result'])
コード例 #6
0
ファイル: libcloud_dns_test.py プロジェクト: bryson/salt
 def test_present_record_does_not_exist(self):
     """
     Try and create a record that already exists
     """
     with patch.object(MockDnsModule, 'create_record') as create_patch:
         result = libcloud_dns.record_present("mail", "test.com", "A", "127.0.0.1", "test")
         self.assertTrue(result)
     create_patch.assert_called_with('mail', "zone1", "A", "127.0.0.1", "test")
コード例 #7
0
ファイル: libcloud_dns_test.py プロジェクト: bryson/salt
 def test_present_record_exists(self):
     """
     Try and create a record that already exists
     """
     with patch.object(MockDnsModule, 'create_record', MagicMock(return_value=True)) as create_patch:
         result = libcloud_dns.record_present("www", "test.com", "A", "127.0.0.1", "test")
         self.assertTrue(result)
     self.assertFalse(create_patch.called)
コード例 #8
0
 def test_present_record_exists(self):
     """
     Try and create a record that already exists
     """
     result = libcloud_dns.record_present(
         "www", "test.com", "A", "127.0.0.1", "test"
     )
     self.assertTrue(result)
コード例 #9
0
 def test_present_record_exists(self):
     """
     Try and create a record that already exists
     """
     with patch.object(MockDnsModule, 'create_record',
                       MagicMock(return_value=True)) as create_patch:
         result = libcloud_dns.record_present("www", "test.com", "A",
                                              "127.0.0.1", "test")
         self.assertTrue(result)
     self.assertFalse(create_patch.called)
コード例 #10
0
 def test_present_record_does_not_exist(self):
     """
     Try and create a record that already exists
     """
     with patch.object(MockDnsModule, 'create_record') as create_patch:
         result = libcloud_dns.record_present("mail", "test.com", "A",
                                              "127.0.0.1", "test")
         self.assertTrue(result)
     create_patch.assert_called_with('mail', "zone1", "A", "127.0.0.1",
                                     "test")