示例#1
0
 def test_matrix_calls_axis(self):
     matrix = Matrix()
     axis = mock.Mock()
     matrix.add_axis(axis)
     cases = [mock.Mock()]
     matrix.expand(cases)
     axis.expand.assert_called_once_with(cases)
示例#2
0
 def test_matrix_both_axes(self):
     matrix = Matrix()
     matrix.add_axis(PythonAxis(["2.7"]))
     matrix.add_axis(AnsibleAxis(["2.8"]))
     case = mock.Mock()
     case.expand_python.return_value = case
     case.expand_ansible.return_value = case
     matrix.expand([case])
     self.assertEqual(2, len(matrix.axes))
     case.expand_python.assert_called_once_with("2.7")
     case.expand_ansible.assert_called_once_with("2.8")
示例#3
0
 def test_matrix_leaves_out_bare_lint_all(self):
     matrix = Matrix()
     matrix.add_axis(PythonAxis(["2.7", "3.8"]))
     cases = [ToxLintCase([])]
     expanded = matrix.expand(cases)
     self.assertEqual(2, len(expanded))
示例#4
0
 def test_empty_matrix(self):
     cases = [ToxTestCase(mock.Mock(), mock.Mock()), ToxLintCase([])]
     original = copy(cases)
     matrix = Matrix()
     after_cases = matrix.expand(cases)
     self.assertEqual(after_cases, original)