Exemplo n.º 1
0
 def test_create_artifact_writes_to_disk_iteration_0_no_test_dir(self):
     host = FakeHost()
     output_dir = '%stmp' % host.sep
     ar = artifacts.Artifacts(output_dir, host)
     file_rel_path = host.join('stdout', 'test.jpg')
     ar.CreateArtifact('artifact_name', file_rel_path, b'contents')
     self.assertEqual(
         host.read_binary_file(host.join(output_dir, 'stdout', 'test.jpg')),
         b'contents')
Exemplo n.º 2
0
 def test_create_artifact_writes_to_disk_initial_results_dir(self):
     host = FakeHost()
     output_dir = '%stmp' % host.sep
     ar = artifacts.Artifacts(output_dir,
                              host,
                              iteration=0,
                              test_name='a.b.c',
                              intial_results_base_dir=True)
     file_rel_path = host.join('stdout', 'test.jpg')
     ar.CreateArtifact('artifact_name', file_rel_path, b'contents')
     self.assertEqual(
         host.read_binary_file(
             host.join(output_dir, 'a.b.c', 'initial', 'stdout',
                       'test.jpg')), b'contents')