Пример #1
0
def test_go(fixtures_dir, input_filename, summary_filename, tmpdir, null_string):
    output_file = summarize.go(fixtures_dir, input_filename, tmpdir.strpath, 'output', null_string)
    actual_summary_data = common.read_json_file(output_file)

    expected_summary_data = common.read_json_file(os.path.join(fixtures_dir, summary_filename))

    # the "file" key is a full path to the summary file and can't be tested across different machines
    expected_keys = expected_summary_data.keys()
    assert actual_summary_data.keys() == expected_keys
    for key in expected_keys:
        if key != 'file':
            assert actual_summary_data[key] == expected_summary_data[key]
Пример #2
0
def test_go(mock_client, fixtures_dir, input_filename, trellosummary_filename,
            tmpdir):
    mock_client.add_board().url = 'MOCK_BOARD_URL'
    mock_client.add_board().add_list().add_card().url = 'MOCK_CARD_URL'
    output_filename = build_trello.go(fixtures_dir, input_filename,
                                      tmpdir.strpath, '')
    actual_summary_data = common.read_json_file(output_filename)
    # TODO: add asserts on mock calls

    expected_summary_data = common.read_json_file(
        os.path.join(fixtures_dir, trellosummary_filename))
    assert actual_summary_data == expected_summary_data
Пример #3
0
def test_write_summary(tmpdir):
    summary_data = {'a': 1, 'b': {'c': 2, 'd': 3}, 'e': [1, 2, 3]}
    filename = common.write_summary(summary_data, tmpdir.strpath, 'foo', 'bar')
    assert os.path.basename(filename) == 'foo_barsummary.json'

    summary_data_from_file = common.read_json_file(filename)
    assert summary_data_from_file == summary_data
 def set_trello_summary_data(self):
     trello_summary_file = common.get_summary_filename(self.summary_dir, self.base_name, 'trello')
     common.file_exists_or_exit(
         trello_summary_file, 'Please create the Trello summary file with '
                              '"tddc build_trello <input_file> [--output=<dir>]'
     )
     self._trello_summary = common.read_json_file(trello_summary_file)
     print('Retrieved Trello summary data.')
 def set_summary_data(self):
     summary_file = common.get_summary_filename(self.summary_dir, self.base_name)
     common.file_exists_or_exit(
         summary_file, 'Please create the summary file with '
                       '"tddc summarize <input_file> [--output=<dir>] [--null=<NA>]".'
     )
     self._summary = common.read_json_file(summary_file)
     print('Retrieved summary data.')
Пример #6
0
 def set_trello_summary_data(self):
     trello_summary_file = common.get_summary_filename(
         self.summary_dir, self.base_name, 'trello')
     common.file_exists_or_exit(
         trello_summary_file, 'Please create the Trello summary file with '
         '"tddc build_trello <input_file> [--output=<dir>]')
     self._trello_summary = common.read_json_file(trello_summary_file)
     print('Retrieved Trello summary data.')
Пример #7
0
 def set_summary_data(self):
     summary_file = common.get_summary_filename(self.summary_dir,
                                                self.base_name)
     common.file_exists_or_exit(
         summary_file, 'Please create the summary file with '
         '"tddc summarize <input_file> [--output=<dir>] [--null=<NA>]".')
     self._summary = common.read_json_file(summary_file)
     print('Retrieved summary data.')