Esempio n. 1
0
 def test_has_owner(self):
     owners.reset_owners()
     o = 12345
     self.assertTrue(owners.add_file_owner(self.f, o))
     self.assertTrue(owners.has_owner(self.f))
Esempio n. 2
0
 def test_remove_file_owner(self):
     owners.reset_owners()
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertTrue(owners.remove_file_owner(self.f))
     self.assertFalse(owners.remove_file_owner(self.f))
Esempio n. 3
0
 def test_get_owner(self):
     owners.reset_owners()
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertEqual(owners.get_owner(self.f), 123, "file is owned")
     self.assertEqual(owners.get_owner("random_stuff.txt"), -1, "file is not owned")
Esempio n. 4
0
 def test_add_file_owner(self):
     owners.reset_owners()
     self.assertFalse(owners.add_file_owner("testing", -1))
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertTrue(owners.add_file_owner(self.f, 456))
 def test_has_owner(self):
     owners.reset_owners()
     o = 12345
     self.assertTrue(owners.add_file_owner(self.f, o))
     self.assertTrue(owners.has_owner(self.f))
 def test_get_owner(self):
     owners.reset_owners()
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertEqual(owners.get_owner(self.f), 123, "file is owned")
     self.assertEqual(owners.get_owner("random_stuff.txt"), -1,
                      "file is not owned")
 def test_remove_file_owner(self):
     owners.reset_owners()
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertTrue(owners.remove_file_owner(self.f))
     self.assertFalse(owners.remove_file_owner(self.f))
 def test_add_file_owner(self):
     owners.reset_owners()
     self.assertFalse(owners.add_file_owner('testing', -1))
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertTrue(owners.add_file_owner(self.f, 123))
     self.assertTrue(owners.add_file_owner(self.f, 456))