示例#1
0
 def test_multiple_files(self):
     """Multiple leases files on azure with one found return that value."""
     self.maxDiff = None
     populate_dir(self.lease_d, {'1': self.azure_lease,
                                 '9': self.lxd_lease})
     self.assertEqual({'1': self.azure_parsed, '9': self.lxd_parsed},
                      networkd_load_leases(self.lease_d))
示例#2
0
 def test_multiple_files(self):
     """Multiple leases files on azure with one found return that value."""
     self.maxDiff = None
     populate_dir(self.lease_d, {'1': self.azure_lease,
                                 '9': self.lxd_lease})
     self.assertEqual({'1': self.azure_parsed, '9': self.lxd_parsed},
                      networkd_load_leases(self.lease_d))
示例#3
0
 def test_single_azure_leases_file(self):
     """On Azure, option 245 should be present, verify it specifically."""
     populate_dir(self.lease_d, {'1': self.azure_lease})
     self.assertEqual(
         {'1': self.azure_parsed}, networkd_load_leases(self.lease_d))
示例#4
0
 def test_single_leases_file(self):
     """A leases dir with one leases file."""
     populate_dir(self.lease_d, {'2': self.lxd_lease})
     self.assertEqual(
         {'2': self.lxd_parsed}, networkd_load_leases(self.lease_d))
示例#5
0
 def test_no_leases_dir_returns_empty_dict(self):
     """A non-existing leases dir should return empty dict."""
     enodir = os.path.join(self.lease_d, 'does-not-exist')
     self.assertEqual({}, networkd_load_leases(enodir))
示例#6
0
 def test_no_leases_returns_empty_dict(self):
     """A leases dir with no lease files should return empty dictionary."""
     self.assertEqual({}, networkd_load_leases(self.lease_d))
示例#7
0
 def test_single_azure_leases_file(self):
     """On Azure, option 245 should be present, verify it specifically."""
     populate_dir(self.lease_d, {'1': self.azure_lease})
     self.assertEqual(
         {'1': self.azure_parsed}, networkd_load_leases(self.lease_d))
示例#8
0
 def test_single_leases_file(self):
     """A leases dir with one leases file."""
     populate_dir(self.lease_d, {'2': self.lxd_lease})
     self.assertEqual(
         {'2': self.lxd_parsed}, networkd_load_leases(self.lease_d))
示例#9
0
 def test_no_leases_dir_returns_empty_dict(self):
     """A non-existing leases dir should return empty dict."""
     enodir = os.path.join(self.lease_d, 'does-not-exist')
     self.assertEqual({}, networkd_load_leases(enodir))
示例#10
0
 def test_no_leases_returns_empty_dict(self):
     """A leases dir with no lease files should return empty dictionary."""
     self.assertEqual({}, networkd_load_leases(self.lease_d))