Пример #1
0
 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')
Пример #2
0
 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')
Пример #3
0
 def test_set_single_string_contents_via_set_contents(self):
     x = FileMocker()
     x.set_contents('foo')
     self.assertEqual(x('anything.txt').read(), 'foo')
Пример #4
0
 def test_set_single_string_contents_via_set_contents(self):
     x = FileMocker()
     x.set_contents('foo')
     self.assertEqual(x('anything.txt').read(), 'foo')