def test_differs_from_a_project_with_another_invocation(self): self.assertNotEqual( FlapTestCase( "foo", a_project().with_main_file("blabla").build(), a_project().with_merged_file("something different").build(), Invocation("foo.tex"), False, [Fragment("test.tex", 1, 1, r"\input{foo}")]), self.test_case)
def test_parsing_a_test_case_with_invocation(self): yaml_file = self._create_file(YamlTest.that_includes_invocation("Test 1")) test_case = self._read_test_case_from(yaml_file) expected = FlapTestCase( "Test 1", a_project().with_main_file("blabla").build(), a_project().with_merged_file("blabla").build(), Invocation(tex_file="foo.tex"), skipped=False) self.assertEqual(expected, test_case)
def _extract_invocation_from(self, project): if self.INVOCATION_KEY in project: invocation = project[self.INVOCATION_KEY] if self.TEX_FILE_KEY in invocation: return Invocation(invocation[self.TEX_FILE_KEY]) return Invocation()
def test_differs_from_a_different_invocation(self): self.assertNotEqual(Invocation("bar.tex"), self._invocation)
def test_equals_similar_invocation(self): self.assertEqual(Invocation(self._tex_file), self._invocation)
def test_default_tex_file(self): invocation = Invocation() self.assertEqual(Invocation.DEFAULT_TEX_FILE, invocation.tex_file)
def setUp(self): self._tex_file = "foo.tex" self._invocation = Invocation(self._tex_file)