Example #1
0
 def test_multiple_choice(self):
     t = models.Test(type=models.MULTIPLE_CHOICE, choices="foo,bar,baz")
     tol = models.Tolerance(type=models.MULTIPLE_CHOICE,
                            mc_tol_choices="foo",
                            mc_pass_choices="")
     result = qa_tags.reference_tolerance_span(t, None, tol)
     self.assertIn("Tolerance Values", result)
Example #2
0
 def test_absolute(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     tol = models.Tolerance(
         type=models.ABSOLUTE,
         act_low=-2, tol_low=-1, tol_high=1, act_high=2,
     )
     result = qa_tags.reference_tolerance_span(t, r, tol)
     self.assertIn("ACT L", result)
Example #3
0
 def test_percent(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     tol = models.Tolerance(
         type=models.PERCENT,
         act_low=-2, tol_low=-1, tol_high=1, act_high=2,
     )
     result = qa_tags.reference_tolerance_span(t, r, tol)
     self.assertIn("(-2.00%", result)
Example #4
0
 def test_absolute(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     tol = models.Tolerance(
         type=models.ABSOLUTE,
         act_low=-2, tol_low=-1, tol_high=1, act_high=2,
     )
     result = qa_tags.reference_tolerance_span(t, r, tol)
     self.assertIn("%s L" % (settings.TEST_STATUS_DISPLAY_SHORT['action']), result)
Example #5
0
 def test_absolute(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     tol = models.Tolerance(
         type=models.ABSOLUTE,
         act_low=-2,
         tol_low=-1,
         tol_high=1,
         act_high=2,
     )
     result = qa_tags.reference_tolerance_span(t, r, tol)
     self.assertIn("ACT L", result)
Example #6
0
 def test_percent(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     tol = models.Tolerance(
         type=models.PERCENT,
         act_low=-2,
         tol_low=-1,
         tol_high=1,
         act_high=2,
     )
     result = qa_tags.reference_tolerance_span(t, r, tol)
     self.assertIn("(-2.00%", result)
Example #7
0
 def test_multiple_choice(self):
     t = models.Test(type=models.MULTIPLE_CHOICE, choices="foo,bar,baz")
     tol = models.Tolerance(type=models.MULTIPLE_CHOICE, mc_tol_choices="foo", mc_pass_choices="")
     result = qa_tags.reference_tolerance_span(t, None, tol)
     self.assertIn("Tolerance Values", result)
Example #8
0
 def test_no_tol(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     result = qa_tags.reference_tolerance_span(t, r, None)
     self.assertIn("No Tolerance", result)
Example #9
0
 def test_bool(self):
     t = models.Test(type=models.BOOLEAN)
     r = models.Reference(value=1)
     self.assertIn("Passing value", qa_tags.reference_tolerance_span(t, r, None))
Example #10
0
 def test_no_ref_no_tol(self):
     t = models.Test(type=models.MULTIPLE_CHOICE)
     self.assertIn("No Tol", qa_tags.reference_tolerance_span(t, None, None))
Example #11
0
 def test_no_ref(self):
     t = models.Test(type=models.BOOLEAN)
     self.assertIn("No Ref", qa_tags.reference_tolerance_span(t, None, None))
Example #12
0
 def test_no_tol(self):
     t = models.Test(type=models.NUMERICAL)
     r = models.Reference(value=1)
     result = qa_tags.reference_tolerance_span(t, r, None)
     self.assertIn("No Tolerance", result)
Example #13
0
 def test_bool(self):
     t = models.Test(type=models.BOOLEAN)
     r = models.Reference(value=1)
     self.assertIn("Passing value",
                   qa_tags.reference_tolerance_span(t, r, None))
Example #14
0
 def test_no_ref_no_tol(self):
     t = models.Test(type=models.MULTIPLE_CHOICE)
     self.assertIn("No Tol",
                   qa_tags.reference_tolerance_span(t, None, None))
Example #15
0
 def test_no_ref(self):
     t = models.Test(type=models.BOOLEAN)
     self.assertIn("No Ref",
                   qa_tags.reference_tolerance_span(t, None, None))