def test_tool_constructor__config(): problems = Problems() config = {'good': 'value'} tool = tools.Tool(problems, config) eq_(tool.options, config) tool = tools.Tool(problems, 'derp') eq_(tool.options, {}) tool = tools.Tool(problems, 2) eq_(tool.options, {}) tool = tools.Tool(problems, None) eq_(tool.options, {})
def test_tool_constructor__config(self): problems = Problems() config = {'good': 'value'} tool = tools.Tool(problems, config) self.assertEqual(tool.options, config) tool = tools.Tool(problems, 'derp') self.assertEqual(tool.options, {}) tool = tools.Tool(problems, 2) self.assertEqual(tool.options, {}) tool = tools.Tool(problems, None) self.assertEqual(tool.options, {})
def test_tool_apply_base__with_base(): problems = Problems() tool = tools.Tool(problems, {}, fixtures_path) result = tool.apply_base('comments_current.json') eq_(result, fixtures_path + '/comments_current.json') result = tool.apply_base('./comments_current.json') eq_(result, fixtures_path + '/comments_current.json') result = tool.apply_base('eslint/config.json') eq_(result, fixtures_path + '/eslint/config.json') result = tool.apply_base('./eslint/config.json') eq_(result, fixtures_path + '/eslint/config.json') result = tool.apply_base('../fixtures/eslint/config.json') eq_(result, fixtures_path + '/eslint/config.json')
def test_tool_apply_base__with_base_no_traversal(): problems = Problems() tool = tools.Tool(problems, {}, fixtures_path) result = tool.apply_base('../../../comments_current.json') eq_(result, 'comments_current.json')
def test_tool_apply_base__no_base(): problems = Problems() tool = tools.Tool(problems, {}) result = tool.apply_base('comments_current.json') eq_(result, 'comments_current.json')
def test_tool_apply_base__no_base(self): problems = Problems() tool = tools.Tool(problems, {}) result = tool.apply_base('comments_current.json') self.assertEqual(result, 'comments_current.json')