Пример #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)
Пример #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)
Пример #3
0
 def test_garbage_collection(self):
     eq_(ActivityLog.objects.all().count(), 1)
     mkt_gc()
     eq_(ActivityLog.objects.all().count(), 0)
Пример #4
0
 def test_garbage_collection(self):
     eq_(ActivityLog.objects.all().count(), 1)
     mkt_gc()
     eq_(ActivityLog.objects.all().count(), 0)
Пример #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
Пример #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')
Пример #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)
Пример #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
Пример #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')
Пример #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)