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())
def test_from_file_with_path_should_return_source_with_data(self): self.assertEqual(b'compressed file', Source.from_file(dummy_file).to_buffer())
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)
def test_from_file_should_raise_account_error(self): with self.assertRaises(AccountError): Source.from_file(dummy_file)
def test_from_file_with_path_should_return_source(self): self.assertIsInstance(Source.from_file(dummy_file), Source)