Beispiel #1
0
 def test_incoming(self):
     handler = ResponseHandler(DummyCollection("incoming"),
                               DummyTemplater())
     result = handler.recommendation()
     expected = "Berikut adalah hari libur dan rekomendasi cuti untuk 3 bulan mendatang\n"
     expected += "With recommendation: Dummy Holiday: 2018-01-04\n"
     self.assertEqual(result, expected, "recommendation not match")
Beispiel #2
0
    def test_empty(self):
        handler = ResponseHandler(DummyCollection("empty"), DummyTemplater())
        result = handler.year()

        expected = "Berikut adalah hari libur untuk tahun {year}\n".format_map(
            {'year': datetime.now().year})
        self.assertEqual(result, expected, "year not match")
Beispiel #3
0
 def test_incoming(self):
     handler = ResponseHandler(DummyCollection("incoming"),
                               DummyTemplater())
     result = handler.incoming()
     expected = "Berikut adalah hari libur untuk 3 bulan yang akan datang\n"
     expected += "Holiday only: Dummy Holiday: 2018-01-04\n"
     expected += '\nUntuk melihat rekomendasi cuti, silakan pilih "Rekomendasi cuti"\n'
     self.assertEqual(result, expected, "incoming not match")
Beispiel #4
0
    def test_incoming(self):
        handler = ResponseHandler(DummyCollection("incoming"),
                                  DummyTemplater())
        result = handler.year()

        expected = "Berikut adalah hari libur untuk tahun 2018\n"
        expected += "Holiday only: Dummy Holiday: 2018-01-04\n"
        self.assertEqual(result, expected, "year not match")
Beispiel #5
0
    def test_empty(self):
        handler = ResponseHandler(DummyCollection("empty"), DummyTemplater())
        result = handler.year(2017)

        expected = "Berikut adalah hari libur untuk tahun 2017\n"
        self.assertEqual(result, expected, "year not match")
Beispiel #6
0
 def test_empty(self):
     handler = ResponseHandler(DummyCollection("empty"), DummyTemplater())
     result = handler.recommendation()
     expected = "Berikut adalah hari libur dan rekomendasi cuti untuk 3 bulan mendatang\n"
     self.assertEqual(result, expected, "recommendation not match")