コード例 #1
0
 def setUp(self):
     from get_database import get_profile_db, get_uuid_db, get_client_db, get_pending_signup_db
     # Make sure we start with a clean slate every time
     get_client_db().remove()
     get_profile_db().remove()
     get_pending_signup_db().remove()
     get_uuid_db().remove()
コード例 #2
0
 def setUp(self):
   from get_database import get_profile_db, get_uuid_db, get_client_db, get_pending_signup_db
   # Make sure we start with a clean slate every time
   get_client_db().remove()
   get_profile_db().remove()
   get_pending_signup_db().remove()
   get_uuid_db().remove()
コード例 #3
0
 def setUp(self):
   # Make sure we start with a clean slate every time
   self.serverName = 'localhost'
   common.dropAllCollections(get_db())
   logging.info("After setup, client count = %d, profile count = %d, uuid count = %d" % 
     (get_client_db().find().count(), get_profile_db().count(), get_uuid_db().count()))
   load_database_json.loadTable(self.serverName, "Stage_Modes", "tests/data/modes.json")
コード例 #4
0
ファイル: client.py プロジェクト: sfwatergit/e-mission-server
  def __reload(self):
    self.clientJSON = None
    if self.clientName is not None:
      self.clientJSON = get_client_db().find_one({'name': self.clientName})

    # clientJSON can be None if we are creating an entry for the first time
    if self.clientJSON is None:
      # Avoid Attribute error while trying to determine whether the client is active
      self.startDatetime = None
      self.endDatetime = None
    else:
      # Do eagerly or lazily? Can also do super lazily and have 
      self.startDatetime = dateutil.parser.parse(self.clientJSON['start_date'])
      self.endDatetime = dateutil.parser.parse(self.clientJSON['end_date'])
コード例 #5
0
    def __reload(self):
        self.clientJSON = None
        if self.clientName is not None:
            self.clientJSON = get_client_db().find_one(
                {'name': self.clientName})

        # clientJSON can be None if we are creating an entry for the first time
        if self.clientJSON is None:
            # Avoid Attribute error while trying to determine whether the client is active
            self.startDatetime = None
            self.endDatetime = None
        else:
            # Do eagerly or lazily? Can also do super lazily and have
            self.startDatetime = dateutil.parser.parse(
                self.clientJSON['start_date'])
            self.endDatetime = dateutil.parser.parse(
                self.clientJSON['end_date'])
コード例 #6
0
 def __update(self, newEntry):
     get_client_db().update({'name': self.clientName},
                            newEntry,
                            upsert=True)
     self.__reload()
コード例 #7
0
ファイル: client.py プロジェクト: sfwatergit/e-mission-server
 def __update(self, newEntry):
   get_client_db().update({'name': self.clientName}, newEntry, upsert = True)
   self.__reload()