Exemple #1
0
 def test_dump_delete(self):
     time_for_temp = (time.time() - DUMPED_APPS_WRITTEN - 1, time.time() - DUMPED_APPS_WRITTEN - 1)
     os.utime(DUMPED_APPS_PATH, time_for_temp)
     sum_test = len( [files for files in os.listdir(DUMPED_APPS_PATH)] )
     assertEqual(sum_test, 1)
     mkt_gc()
     assertEqual(sum_test, 0)
Exemple #2
0
 def test_dump_delete(self):
     time_for_temp = (time.time() - DUMPED_APPS_WRITTEN - 1,
                      time.time() - DUMPED_APPS_WRITTEN - 1)
     os.utime(DUMPED_APPS_PATH, time_for_temp)
     sum_test = len([files for files in os.listdir(DUMPED_APPS_PATH)])
     assertEqual(sum_test, 1)
     mkt_gc()
     assertEqual(sum_test, 0)
Exemple #3
0
 def test_garbage_collection(self):
     eq_(ActivityLog.objects.all().count(), 1)
     mkt_gc()
     eq_(ActivityLog.objects.all().count(), 0)
Exemple #4
0
 def test_garbage_collection(self):
     eq_(ActivityLog.objects.all().count(), 1)
     mkt_gc()
     eq_(ActivityLog.objects.all().count(), 0)
Exemple #5
0
    def test_new_no_delete(self, rm_mock, ls_mock, stat_mock):
        ls_mock.return_value = ['lol']
        stat_mock.return_value = StatMock(days_ago=1)

        mkt_gc()
        assert not rm_mock.called
Exemple #6
0
    def test_dump_delete(self, rm_mock, ls_mock, stat_mock):
        ls_mock.return_value = ['lol']
        stat_mock.return_value = StatMock(days_ago=1000)

        mkt_gc()
        assert rm_mock.call_args_list[0][0][0].endswith('lol')
Exemple #7
0
 def test_garbage_collection(self, rm_mock, ls_mock, stat_mock):
     eq_(ActivityLog.objects.all().count(), 1)
     mkt_gc()
     eq_(ActivityLog.objects.all().count(), 0)
Exemple #8
0
    def test_new_no_delete(self, rm_mock, ls_mock, stat_mock):
        ls_mock.return_value = ['lol']
        stat_mock.return_value = StatMock(days_ago=1)

        mkt_gc()
        assert not rm_mock.called
Exemple #9
0
    def test_dump_delete(self, rm_mock, ls_mock, stat_mock):
        ls_mock.return_value = ['lol']
        stat_mock.return_value = StatMock(days_ago=1000)

        mkt_gc()
        assert rm_mock.call_args_list[0][0][0].endswith('lol')
Exemple #10
0
 def test_garbage_collection(self, rm_mock, ls_mock, stat_mock):
     eq_(ActivityLog.objects.all().count(), 1)
     mkt_gc()
     eq_(ActivityLog.objects.all().count(), 0)