Esempio n. 1
0
 def test_record_named(self, capfd):
     out, err = run_ofSM('record -p mockProject -n snapshot-1', capfd=capfd)
     assert 'DEBUG' not in out
     assert 'DEBUG' not in err
     std = load_json_file(os.path.join(REPLAY_DIR,
                                       'md_record_snapshot-1.json'))
     test = load_json_file(os.path.join('mockProject', 'metadata.json'))
     assert test == std
Esempio n. 2
0
 def test_record_default_p_dir(self):
     currentdir = os.getcwd()
     os.chdir('mockProject')
     run_ofSM('record')
     std = load_json_file(os.path.join(REPLAY_DIR, 'md_record.json'))
     test = load_json_file(os.path.join(currentdir, 'mockProject',
                                     'metadata.json'))
     assert test == std
Esempio n. 3
0
    def test_record_verbosity(self, capfd):
        out, _ = run_ofSM('record -v -p mockProject -n snapshot-1',
                          capfd=capfd)
        assert 'DEBUG' in out

        std = load_json_file(os.path.join(REPLAY_DIR,
                                          'md_record_snapshot-1.json'))
        test = load_json_file(os.path.join('mockProject', 'metadata.json'))
        assert test == std
Esempio n. 4
0
 def test_record_remotedir(self):
     currentdir = os.getcwd()
     os.chdir(os.path.dirname(SCRIPT_LOC))
     ret = script_cmd(
         os.path.join('./', os.path.basename(SCRIPT_LOC)) + ' record -p ' +
         os.path.join(currentdir, 'mockProject'),
         os.getcwd())
     assert ret == 0
     std = load_json_file(os.path.join(REPLAY_DIR, 'md_record.json'))
     test = load_json_file(os.path.join(currentdir, 'mockProject',
                                     'metadata.json'))
     assert test == std
Esempio n. 5
0
    def test_record_update(self):
        # copy snapshot-1 metadata file over to mockProject
        shutil.copyfile(os.path.join(REPLAY_DIR, 'md_record_snapshot-1.json'),
                        os.path.join('mockProject', 'metadata.json'))
        # this has to bail because -u was not given
        run_ofSM('record -p mockProject -n snapshot-1', desired_exit_status=1)
        # this has to work
        run_ofSM('record -u -p mockProject -n snapshot-1')

        std = load_json_file(os.path.join(REPLAY_DIR,
                                          'md_record_snapshot-1.json'))
        test = load_json_file(os.path.join('mockProject', 'metadata.json'))
        assert test == std
Esempio n. 6
0
 def test_record_description(self):
     run_ofSM('record -p mockProject -d "My Test description"')
     std = load_json_file(os.path.join(REPLAY_DIR,
                                       'md_record_description.json'))
     test = load_json_file(os.path.join('mockProject', 'metadata.json'))
     assert test == std
Esempio n. 7
0
 def test_record(self):
     run_ofSM('record -p mockProject')
     std = load_json_file(os.path.join(REPLAY_DIR, 'md_record.json'))
     test = load_json_file(os.path.join('mockProject', 'metadata.json'))
     assert test == std