Ejemplo n.º 1
0
    def test_get_seanse(self):
        with app.test_request_context():
            # mock object
            resp = get_seanse(3)
            seanse = resp.json["seanse"]
            m1 = {"hall_number": 3, "id": 3, "movie_title": 'Mirror                                            '}

            self.assertEqual(sorted(seanse.items()), sorted(m1.items()))
Ejemplo n.º 2
0
    def test_delete_seanse(self):
        with app.test_request_context():
            # mock object
            client = app.test_client()
            resp = client.delete('/api/1.0/seanses/10')
            print(resp)
            res = resp.json["Result of deleting"]

            self.assertEqual(res, 'Succes')
Ejemplo n.º 3
0
 def test_post_seanse(self):
     with app.test_request_context():
         # mock object
         client = app.test_client()
         m1 = {"hall_number": 10, "id": 10, "movie_title": '99 franks'}
         resp = client.post('/api/1.0/seanses', json = m1)
         print(resp.json)
         seanse = resp.json["New seanse"]
         self.assertEqual(sorted(seanse.items()), sorted(m1.items()))
Ejemplo n.º 4
0
 def test_get_seanses(self):
     with app.test_request_context():
         # mock object
         resp = get_seanses()
         #print(resp.json["seanses"][0])
         seanses = resp.json["seanses"]
         count = len(seanses)
         self.assertEqual(count, 5)
         seanse1 = seanses[4]
         print(seanse1)
         m1 = {"hall_number": 3, "id": 3, "movie_title": 'Mirror                                            '}
         self.assertEqual(sorted(seanse1.items()), sorted(m1.items()))
Ejemplo n.º 5
0
    def test_put_seanse(self):
        with app.test_request_context():
            # mock object
            client = app.test_client()
            resp = client.put('/api/1.0/seanses/3', 
                    json = {'value': 3, 'object': 'hall_number'})
            res = resp.json["Result of updating"]
            self.assertEqual(res, 'Succes')

            resp = client.put('/api/1.0/seanses/3', 
                    json = {'value': 'Mirror', 'object': 'movie_title'})
            res = resp.json["Result of updating"]
            self.assertEqual(res, 'Succes')