def test_add_date_language_both(self):
        """Test add_date_language() with both dates."""
        input = "Current sentence"
        expected = "Current sentence between May 1, 2016, and Dec. 31, 2016,"

        rl = ResultsLanguage(standard_data)
        actual = rl.add_date_language(input)

        self.assertEqual(actual, expected)
Example #2
0
    def test_add_date_language_both(self):
        """Test add_date_language() with both dates."""
        input = "Current sentence"
        expected = "Current sentence between May 1, 2016, and Dec. 31, 2016,"

        rl = ResultsLanguage(standard_data)
        actual = rl.add_date_language(input)

        self.assertEqual(actual, expected)
    def test_add_date_language_end_only(self):
        """Test add_date_language() with end date only."""
        input = "Current sentence"
        expected = "Current sentence before Dec. 31, 2016,"

        new_data = copy.deepcopy(standard_data)
        new_data["begin_date"] = ""
        rl = ResultsLanguage(new_data)

        actual = rl.add_date_language(input)

        self.assertEqual(actual, expected)
Example #4
0
    def test_add_date_language_end_only(self):
        """Test add_date_language() with end date only."""
        input = "Current sentence"
        expected = "Current sentence before Dec. 31, 2016,"

        new_data = copy.deepcopy(standard_data)
        new_data["begin_date"] = ""
        rl = ResultsLanguage(new_data)

        actual = rl.add_date_language(input)

        self.assertEqual(actual, expected)
    def test_add_date_language_none(self):
        """Test add_date_language() without any new data."""
        input = "Current sentence"
        expected = "Current sentence"

        new_data = copy.deepcopy(standard_data)
        new_data["begin_date"] = ""
        new_data["end_date"] = ""
        rl = ResultsLanguage(new_data)

        actual = rl.add_date_language(input)

        self.assertEqual(actual, expected)
Example #6
0
    def test_add_date_language_none(self):
        """Test add_date_language() without any new data."""
        input = "Current sentence"
        expected = "Current sentence"

        new_data = copy.deepcopy(standard_data)
        new_data["begin_date"] = ""
        new_data["end_date"] = ""
        rl = ResultsLanguage(new_data)

        actual = rl.add_date_language(input)

        self.assertEqual(actual, expected)