Exemplo n.º 1
0
 def test_d_check_status_license_link(self):
   """- Check if the 'license' link is a valid https url"""
   status = Status(self.license)
   status.update_status()
   link = status.get_link('license', 'href')
   self.assertIsNotNone(link)
   self.assertTrue(link.startswith('https://'))
Exemplo n.º 2
0
 def setUpClass(cls):
     # get config
     cls.config = TestConfig('l1')
     license = License(cls.config.license())
     # Get status from config license
     status = Status(license)
     status.update_status()
     cls.license = status.update_license()
Exemplo n.º 3
0
    def setUpClass(cls):
        # get config
        cls.config = TestConfig('b1')
        license = License(cls.config.license())
        status = Status(license)
        status.update_status()

        # Get license from status
        cls.license = status.update_license()
Exemplo n.º 4
0
 def setUpClass(cls):
     cls.config = TestConfig('b1')
     license = License(cls.config.license())
     cls.status = Status(license)
     cls.status.update_status()
     cls.original_time = cls.status.get_updated_status()
     cls.original_events = cls.status.get_events()
Exemplo n.º 5
0
 def setUpClass(cls):
     # get config
     cls.config = TestConfig('l1')
     license = License(cls.config.license())
     # Get status from config license
     cls.status = Status(license)
     cls.status.update_status()
     cls.end = license.get_end()
Exemplo n.º 6
0
 def setUpClass(cls):
   # get config
   cls.config = TestConfig('b1')
   license = License(cls.config.license())
   # Get status from config license
   cls.status = Status(license)
   cls.status.update_status()
   cls.original_time = cls.status.get_updated_status()
Exemplo n.º 7
0
 def test_b_check_status_document(self):
   """- Check that the JSON document is valid, using the corresponding JSON schema"""
   status = Status(self.license)
   status.update_status()
   self.assertIsNotNone(status)
   try:
     status.check_schema()
   except:
     self.fail("Status schema validation failure {}".format(status.status))
Exemplo n.º 8
0
 def test_e_check_license_mimetype(self):
   """- Check that the corresponding mime-type is 'application/vnd.readium.lcp.license.v1.0+json'"""
   status = Status(self.license)
   status.update_status()
   mimetype = status.get_link('license', 'type')
   self.assertEquals(mimetype, License.LICENSE_MIMETYPE)
Exemplo n.º 9
0
 def test_c_status_events(self):
   """- Check if events are (or not) available"""
   status = Status(self.license)
   status.update_status()
   events = status.get_events()
   self.assertIsNotNone(events, "This is not an ERROR : no events are available in the status document") 
Exemplo n.º 10
0
 def setUpClass(cls):
     cls.config = TestConfig('b3')
     cls.license = License(cls.config.license())
     cls.status = Status(cls.license)
     cls.status.update_status()