Exemplo n.º 1
0
    def create(self, form):
        office = OfficeModel(form["city"], form["state"], form["seasonYear"],
                             form["seasonMonth"], form["skypeChatId"],
                             util.generateUUID(), True, datetime.now(),
                             datetime.now())
        db.session.add(office)
        db.session.commit()

        app.logger.info("Creating office=%s city=%s state=%s skypeChatId=%s",
                        office.id, office.city, office.state,
                        office.skypeChatId)

        return office
Exemplo n.º 2
0
 def test_generateUUID(self):
     uuid1 = util.generateUUID()
     uuid2 = util.generateUUID()
     assert uuid1 != None
     assert len(uuid1) == 36
     assert uuid1 != uuid2
Exemplo n.º 3
0
	def test_scoreUnauthorized(self):
		for color in matchService.colors:
			rv = self.app.post("/api/buttons/{}/score".format(color), data = { "key": util.generateUUID() })
			assert rv.status == self.unauthorized
			self.checkUnauthorizedResponse(rv.data)
Exemplo n.º 4
0
	def test_ismsUnauthorized(self):
		rv = self.app.get("/api/isms.json?key={}".format(util.generateUUID()))
		assert rv.status == self.unauthorized
		self.checkUnauthorizedResponse(rv.data)
Exemplo n.º 5
0
	def test_matchUnauthorized(self):
		with self.request:
			rv = self.app.get("/api/matches/{}.json?key={}".format(0, util.generateUUID()))
			assert rv.status == self.unauthorized
			self.checkUnauthorizedResponse(rv.data)
Exemplo n.º 6
0
	def create(self, form):
		office = OfficeModel(form["city"], form["state"], form["seasonYear"], form["seasonMonth"], form["skypeChatId"], util.generateUUID(), True, datetime.now(), datetime.now())
		db.session.add(office)
		db.session.commit()

		app.logger.info("Creating office=%s city=%s state=%s skypeChatId=%s", office.id, office.city, office.state, office.skypeChatId)

		return office
Exemplo n.º 7
0
	def test_generateUUID(self):
		uuid1 = util.generateUUID()
		uuid2 = util.generateUUID()
		assert uuid1 != None
		assert len(uuid1) == 36
		assert uuid1 != uuid2
Exemplo n.º 8
0
 def test_scoreUnauthorized(self):
     for color in matchService.colors:
         rv = self.app.post("/api/buttons/{}/score".format(color),
                            data={"key": util.generateUUID()})
         assert rv.status == self.unauthorized
         self.checkUnauthorizedResponse(rv.data)
Exemplo n.º 9
0
 def test_ismsUnauthorized(self):
     rv = self.app.get("/api/isms.json?key={}".format(util.generateUUID()))
     assert rv.status == self.unauthorized
     self.checkUnauthorizedResponse(rv.data)
Exemplo n.º 10
0
 def test_matchUnauthorized(self):
     with self.request:
         rv = self.app.get("/api/matches/{}.json?key={}".format(
             0, util.generateUUID()))
         assert rv.status == self.unauthorized
         self.checkUnauthorizedResponse(rv.data)