def test_who(self): self.assertFalse(os.path.isfile(os.path.join(TESTDIR, '1=Twain,M.'))) namaste.who(TESTDIR, "Twain,M.") self.assertTrue(os.path.isfile(os.path.join(TESTDIR, '1=Twain,M.'))) f = open(os.path.join(TESTDIR, '1=Twain,M.')) self.assertEqual(f.read(), "Twain,M.\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')), ])