Пример #1
0
 def test_from_file_with_file_object_should_return_source_with_data(self):
     with open(dummy_file, 'rb') as f:
         self.assertEqual(b'compressed file',
                          Source.from_file(f).to_buffer())
Пример #2
0
 def test_from_file_with_path_should_return_source_with_data(self):
     self.assertEqual(b'compressed file',
                      Source.from_file(dummy_file).to_buffer())
Пример #3
0
 def test_from_file_with_file_object_should_return_source(self):
     with open(dummy_file, 'rb') as f:
         self.assertIsInstance(Source.from_file(f), Source)
Пример #4
0
 def test_from_file_should_raise_account_error(self):
     with self.assertRaises(AccountError):
         Source.from_file(dummy_file)
Пример #5
0
 def test_from_file_with_path_should_return_source(self):
     self.assertIsInstance(Source.from_file(dummy_file), Source)
Пример #6
0
 def test_from_file_with_file_object_should_return_source_with_data(self):
     with open(dummy_file, 'rb') as f:
         self.assertEqual(b'compressed file', Source.from_file(f).to_buffer())
Пример #7
0
 def test_from_file_with_file_object_should_return_source(self):
     with open(dummy_file, 'rb') as f:
         self.assertIsInstance(Source.from_file(f), Source)
Пример #8
0
 def test_from_file_with_path_should_return_source_with_data(self):
     self.assertEqual(b'compressed file', Source.from_file(dummy_file).to_buffer())
Пример #9
0
 def test_from_file_with_path_should_return_source(self):
     self.assertIsInstance(Source.from_file(dummy_file), Source)
Пример #10
0
 def test_from_file_should_raise_account_error(self):
     with self.assertRaises(AccountError):
         Source.from_file(dummy_file)