class TestFileResource(Common, unittest.TestCase): def setUp(self): super(TestFileResource, self).setUp() self.res = FileResource(self.path) def tearDown(self): del self.res super(TestFileResource, self).tearDown() def test_filename(self): with self.res.filename('a.yml') as filename: self.assertEqual( filename, os.path.join(self.path, 'a.yml')) with self.res.get(['subdir', 'b.yml']).filename() as filename: self.assertEqual( filename, os.path.join(self.path, 'subdir', 'b.yml'))
def setUp(self): super(TestFileResource, self).setUp() self.res = FileResource(self.path)