def test_where(self): self.assertFalse(os.path.isfile(os.path.join(TESTDIR, '4=Seattle'))) namaste.where(TESTDIR, "Seattle") self.assertTrue(os.path.isfile(os.path.join(TESTDIR, '4=Seattle'))) f = open(os.path.join(TESTDIR, '4=Seattle')) self.assertEqual(f.read(), "Seattle\n") f.close()
def test_get(self): namaste.dirtype(TESTDIR, 'bagit_0.1') namaste.who(TESTDIR, "Twain,M.") namaste.what(TESTDIR, "Hamlet") namaste.when(TESTDIR, "2005") namaste.where(TESTDIR, "Seattle") tags = namaste.get(TESTDIR) tags.sort() self.assertEqual(tags, [ os.path.join(TESTDIR, namaste._make_namaste(0, 'bagit_0.1')), os.path.join(TESTDIR, namaste._make_namaste(1, 'Twain,M.')), os.path.join(TESTDIR, namaste._make_namaste(2, 'Hamlet')), os.path.join(TESTDIR, namaste._make_namaste(3, '2005')), os.path.join(TESTDIR, namaste._make_namaste(4, 'Seattle')), ])