Example #1
0
  def test_load_input_json(self):
    input_data = {'executable': {'name': 'chrome.dll'},
                  'sources': ['c:\\file', 'C:\\FILE_2']}

    initialized_data = convert_code_tally._normalize_paths(input_data)

    # Ensure that all paths are lower case.
    self.assertEqual(['c:\\file', 'c:\\file_2'], initialized_data['sources'])
Example #2
0
  def test_generate_source_tree(self):
    input_json = convert_code_tally._normalize_paths(INPUT_JSON)
    sizes = convert_code_tally._calculate_sizes(input_json)

    source_tree = convert_code_tally._generate_source_tree(
        INPUT_JSON['sources'], sizes)

    expected_tree = {'c:': {'file': 7.0,
                            'folder': {'file2': 115.0, 'file3': 8.0}}}

    self.assertEqual(expected_tree, source_tree)
Example #3
0
    def test_load_input_json(self):
        input_data = {
            'executable': {
                'name': 'chrome.dll'
            },
            'sources': ['c:\\file', 'C:\\FILE_2']
        }

        initialized_data = convert_code_tally._normalize_paths(input_data)

        # Ensure that all paths are lower case.
        self.assertEqual(['c:\\file', 'c:\\file_2'],
                         initialized_data['sources'])
Example #4
0
    def test_generate_source_tree(self):
        input_json = convert_code_tally._normalize_paths(INPUT_JSON)
        sizes = convert_code_tally._calculate_sizes(input_json)

        source_tree = convert_code_tally._generate_source_tree(
            INPUT_JSON['sources'], sizes)

        expected_tree = {
            'c:': {
                'file': 7.0,
                'folder': {
                    'file2': 115.0,
                    'file3': 8.0
                }
            }
        }

        self.assertEqual(expected_tree, source_tree)