def test_set_multiple_file_via_set_contents(self): x = FileMocker() x.set_contents({'foo.txt': 'foo', 'bar.txt': 'bar'}) self.assertEqual(x('foo.txt').read(), 'foo') self.assertEqual(x('bar.txt').read(), 'bar')
def test_set_single_string_contents_via_set_contents(self): x = FileMocker() x.set_contents('foo') self.assertEqual(x('anything.txt').read(), 'foo')