def test_crash_id(): """Tests creating crash ids""" crash_id = create_crash_id() assert get_date_from_crash_id(crash_id) == '20110906' assert get_date_from_crash_id(crash_id, as_datetime=True).strftime('%Y%m%d') == '20110906' # Defaults to 1 assert get_throttle_from_crash_id(crash_id) == 1
def test_crash_id(): """Tests creating crash ids""" crash_id = create_crash_id() assert get_date_from_crash_id(crash_id) == '20110906' assert get_date_from_crash_id( crash_id, as_datetime=True).strftime('%Y%m%d') == '20110906' # Defaults to 1 assert get_throttle_from_crash_id(crash_id) == 1
def test_crash_id(): """Tests creating crash ids""" crash_id = create_crash_id() assert get_date_from_crash_id(crash_id) == "20110906" assert ( get_date_from_crash_id(crash_id, as_datetime=True).strftime("%Y%m%d") == "20110906" ) # Defaults to 1 assert get_throttle_from_crash_id(crash_id) == 1
def _get_dump_name_path(self, crash_id, dump_name): """Return path for a given dump.""" return os.path.join( self.root, get_date_from_crash_id(crash_id), dump_name, crash_id )
def _get_dump_names_path(self, crash_id): """Return path for where the dump_names list should go.""" return os.path.join( self.root, get_date_from_crash_id(crash_id), 'dump_names', crash_id + '.json' )
def _get_raw_crash_path(self, crash_id): """Return path for where the raw crash should go.""" return os.path.join( self.root, get_date_from_crash_id(crash_id), 'raw_crash', crash_id + '.json' )
def _get_dump_names_path(self, crash_id): """Return path for where the dump_names list should go.""" return os.path.join( self.root, get_date_from_crash_id(crash_id), "dump_names", crash_id + ".json", )
def _get_raw_crash_path(self, crash_id): return 'v2/raw_crash/{entropy}/{date}/{crash_id}'.format( entropy=crash_id[:3], date=get_date_from_crash_id(crash_id), crash_id=crash_id )
def test_crash_id_with_date(): """Tests creating a crash id with a timestamp""" crash_id = create_crash_id(datetime(2016, 10, 4)) assert get_date_from_crash_id(crash_id) == '20161004'
def _get_raw_crash_path(self, crash_id): return 'v2/raw_crash/{entropy}/{date}/{crash_id}'.format( entropy=crash_id[:3], date=get_date_from_crash_id(crash_id), crash_id=crash_id)
def _get_dump_name_path(self, crash_id, dump_name): """Returns path for a given dump""" return os.path.join(self.root, get_date_from_crash_id(crash_id), dump_name, crash_id)
def _get_dump_names_path(self, crash_id): """Returns path for where the dump_names list should go""" return os.path.join(self.root, get_date_from_crash_id(crash_id), 'dump_names', crash_id + '.json')
def _get_raw_crash_path(self, crash_id): """Returns path for where the raw crash should go""" return os.path.join(self.root, get_date_from_crash_id(crash_id), 'raw_crash', crash_id + '.json')
def _get_raw_crash_path(self, crash_id): """Return path for where the raw crash should go.""" return os.path.join(self.root, get_date_from_crash_id(crash_id), "raw_crash", crash_id + ".json")