Example #1
0
    def test_wrong_input_tuple(self):
        try:
            two_lines_overlap(1, (1, 2))
        except TypeError as e:
            result = e

        self.assertEqual(type(result), TypeError)
Example #2
0
    def test_wrong_input_number(self):
        try:
            two_lines_overlap(('a', 'b'), ([1], [2]))
        except TypeError as e:
            result = e

        self.assertEqual(type(result), TypeError)
Example #3
0
    def test_overlap_lines_x2_equals_x4(self):
        line1 = (1, 4)
        line2 = (2, 4)
        expected = 'Overlap'

        self.assertEqual(two_lines_overlap(line1, line2), expected)
Example #4
0
    def test_overlap_lines_x1_equals_x3(self):
        line1 = (1, 2)
        line2 = (1, 3)
        expected = 'Overlap'

        self.assertEqual(two_lines_overlap(line1, line2), expected)
Example #5
0
    def test_overlap_line1_after(self):
        line1 = (1, 3)
        line2 = (2, 4)
        expected = 'Overlap'

        self.assertEqual(two_lines_overlap(line2, line1), expected)
Example #6
0
    def test_overlap_line1_before(self):
        line1 = (1, 3)
        line2 = (2, 4)
        expected = 'Overlap'

        self.assertEqual(two_lines_overlap(line1, line2), expected)
Example #7
0
    def test_no_overlap(self):
        line1 = (1, 2)
        line2 = (3, 4)
        expected = 'No Overlap'

        self.assertEqual(two_lines_overlap(line1, line2), expected)