예제 #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
예제 #2
0
 def test_generateUUID(self):
     uuid1 = util.generateUUID()
     uuid2 = util.generateUUID()
     assert uuid1 != None
     assert len(uuid1) == 36
     assert uuid1 != uuid2
예제 #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)
예제 #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)
예제 #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)
예제 #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
예제 #7
0
	def test_generateUUID(self):
		uuid1 = util.generateUUID()
		uuid2 = util.generateUUID()
		assert uuid1 != None
		assert len(uuid1) == 36
		assert uuid1 != uuid2
예제 #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)
예제 #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)
예제 #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)