cc-3936: Added test for get_owner function of the owner module.

This commit is contained in:
Rudi Grinberg 2012-08-27 12:08:36 -04:00
parent 97bb041ba3
commit 92edaba55c
1 changed files with 7 additions and 0 deletions
python_apps/media-monitor2/tests

View File

@ -25,5 +25,12 @@ class TestMMP(unittest.TestCase):
self.assertTrue( owners.remove_file_owner(self.f) )
self.assertFalse( owners.remove_file_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" )
if __name__ == '__main__': unittest.main()