Ejemplo n.º 1
0
    def test_storage_file_base_name(self):
        storage = LogStorage()

        base = storage.file_base_name("2019/03/16/B-2019-03-16T05-34-47.748885Z.log.gz")

        print(base)
        self.assertEqual(base, "B-2019-03-16T05-34-47.748885Z.log.gz")
Ejemplo n.º 2
0
    def test_storage_list_dir(self):
        storage = LogStorage()
        years = storage.list_dir('')

        for year in years:
            print(year)

            months = storage.list_dir(year)
            for month in months:
                print(month)
Ejemplo n.º 3
0
    def test_process_dir(self):
        storage = LogStorage()

        storage.process_blob_dir("2019/03/16/", self.call_back)
Ejemplo n.º 4
0
    def test_list_dir(self):
        storage = LogStorage()

        print(storage.list_blob_names("2019/03/16/"))
Ejemplo n.º 5
0
    def test_process_blob(self):
        storage = LogStorage()

        storage.process_blob("2019/03/16/B-2019-03-16T05-34-47.748885Z.log.gz", self.call_back)
Ejemplo n.º 6
0
    def test_download_blob(self):
        storage = LogStorage()

        storage.download_blob("2019/03/16/B-2019-03-16T05-34-47.748885Z.log.gz")
Ejemplo n.º 7
0
    def test_storage_list_blobs_names(self):
        storage = LogStorage()
        blobs = storage.list_blob_names('2019/')

        for blob in blobs:
            print(blob)
Ejemplo n.º 8
0
 def test_storage_list_year(self):
     storage = LogStorage()
     years = storage.list_year()
     for year in years:
         print(year)
Ejemplo n.º 9
0
    def test_list_dayanddayafter(self):
        storage = LogStorage()

        print(storage.list_blob_names_by_date_with_padding(2019, 3,19))
Ejemplo n.º 10
0
    def test_process_dir_date(self):
        storage = LogStorage()

        storage.process_blob_date_with_padding(2019, 3, 19, self.call_back)
Ejemplo n.º 11
0
    def load_from_blob_by_date(self, year, month, day):
        log_storage = LogStorage()

        log_storage.process_blob_date_with_padding(year, month, day, self.load_file)
Ejemplo n.º 12
0
    def load_from_blobs(self, path=''):
        log_storage = LogStorage()

        log_storage.process_blob_dir(path, self.load_file)