Esempio n. 1
0
 def test_get_flag_data(self):
     self.assertDictEqual(
         get_flag_data(self.flag_soup),
         {u'until': u'Sunset, July 12, 2016',
          u'why': u'As a mark of respect for the victims of the attack on police officers perpetrated on Thursday, July 7, 2016, in Dallas, Texas',  # noqa
          u'full_text': u'As a mark of respect for the victims of the attack on police officers perpetrated on Thursday, July 7, 2016, in Dallas, Texas, by the authority vested in me as President of the United States by the Constitution and the laws of the United States of America, I hereby order that the flag of the United States shall be flown at half-staff at the White House and upon all public buildings and grounds, at all military posts and naval stations, and on all naval vessels of the Federal Government in the District of Columbia and throughout the United States and its Territories and possessions until sunset, July 12, 2016. I also direct that the flag shall be flown at half-staff for the same length of time at all United States embassies, legations, consular offices, and other facilities abroad, including all military facilities and naval vessels and stations.'  # noqa
          })
Esempio n. 2
0
 def test_correct_output(self):
     # There is only one article about half staff flags
     self.assertListEqual([json.loads(message) for message in self.task.run()],
                          [get_flag_data(get_soup('flag', mock_client))])
Esempio n. 3
0
 def test_ignore_non_flag_data(self):
     self.assertEqual(get_flag_data(self.not_flag_soup), {})