def test_false_has_asym_at_value(self): # test using data from the hw4A-8-1 csv data = self.load_as_gradeable_collections( 'hw4A-tab8-problem1.anon.csv') for d in data: va = Asymptote.VerticalAsymptotes(d['va']) self.assertFalse(va.has_asym_at_value(-5))
def test_get_number_of_asyms(self): # test using data from the hw4A-8-1 csv data = self.load_as_gradeable_collections( 'hw4A-tab8-problem1.anon.csv') for d in data: va = Asymptote.VerticalAsymptotes(d['va']) self.assertEqual(va.get_number_of_asyms(), 3)
def test_none_get_asym_at_value(self): # test using data from the hw4A-8-1 csv data = self.load_as_gradeable_collections( 'hw4A-tab8-problem1.anon.csv') for d in data: va = Asymptote.VerticalAsymptotes(d['va']) v = va.get_asym_at_value(-5) self.assertIsNone(v)
def test_closest_asym_to_value(self): # test using data from the app2-7-1 csv data = self.load_as_gradeable_collections( 'app_2-tab7-problem1.anon.csv') for d in data: va = Asymptote.VerticalAsymptotes(d['va']) dist, v = va.closest_asym_to_value(-1) self.assertLess(dist, 1) self.assertIsNotNone(v)
def test_vertical_asymptote_no_tags(self): data = self.load_as_gradeable_collections('tag_none') d = data[0] va = Asymptote.VerticalAsymptotes(d['va']) self.assertIsNone(va.contains_tag('tag'))
def test_vertical_asymptote_contains_tag_false(self): data = self.load_as_gradeable_collections('tag_data') d = data[0] va = Asymptote.VerticalAsymptotes(d['va']) self.assertIsNone(va.contains_tag('somethingelse'))
def test_vertical_asymptote_has_tag_false(self): data = self.load_as_gradeable_collections('tag_data') d = data[0] va = Asymptote.VerticalAsymptotes(d['va']) self.assertFalse(va.asyms[0].tag_equals('somethingelse'))
def test_horizontal_asymptote_no_tags(self): data = self.load_as_gradeable_collections('tag_none') d = data[0] ha = Asymptote.HorizontalAsymptotes(d['ha']) self.assertIsNone(ha.contains_tag('tag'))
def test_horizontal_asymptote_contains_tag_false(self): data = self.load_as_gradeable_collections('tag_data') d = data[0] ha = Asymptote.HorizontalAsymptotes(d['ha']) self.assertIsNone(ha.contains_tag('somethingelse'))
def test_horizontal_asymptote_has_tag_true(self): data = self.load_as_gradeable_collections('tag_data') d = data[0] ha = Asymptote.HorizontalAsymptotes(d['ha']) self.assertTrue(ha.asyms[0].tag_equals('tag'))