Projet

Général

Profil

0013-trivial-fix-disallowed-name-pylint-warning-52732.patch

Frédéric Péters, 04 avril 2021 17:20

Télécharger (2,69 ko)

Voir les différences:

Subject: [PATCH 13/15] trivial: fix disallowed-name pylint warning (#52732)

 pylint.rc             |  1 -
 tests/test_ctl.py     |  4 ++--
 tests/test_storage.py | 10 +++++-----
 3 files changed, 7 insertions(+), 8 deletions(-)
pylint.rc
14 14
    consider-using-set-comprehension,
15 15
    cyclic-import,
16 16
    deprecated-module,
17
    disallowed-name,
18 17
    duplicate-code,
19 18
    fixme,
20 19
    global-variable-undefined,
tests/test_ctl.py
424 424

  
425 425
class TestAfterJob(AfterJob):
426 426
    def execute(self):
427
        self.foo = WorkflowStatusItem().compute('{{ global_title|default:"FAIL" }}')
427
        self.test_result = WorkflowStatusItem().compute('{{ global_title|default:"FAIL" }}')
428 428
        self.l10n_month = WorkflowStatusItem().compute('{{ "10/10/2010"|date:"F" }}')
429 429

  
430 430

  
......
446 446
    assert AfterJob.get(job.id).status == 'registered'
447 447
    call_command('runjob', '--domain=example.net', '--job-id=%s' % job.id)
448 448
    assert AfterJob.get(job.id).status == 'completed'
449
    assert AfterJob.get(job.id).foo == 'HELLO'
449
    assert AfterJob.get(job.id).test_result == 'HELLO'
450 450
    assert AfterJob.get(job.id).l10n_month == 'October'
451 451

  
452 452
    pub.cfg['language'] = {'language': 'fr'}
tests/test_storage.py
346 346
    for x in range(50):
347 347
        test = Foobar()
348 348
        if x < 20:
349
            test.foo = 'foo'
349
            test.var = 'foo'
350 350
        else:
351
            test.foo = 'bar'
351
            test.var = 'bar'
352 352
        test.store()
353 353

  
354
    test.foo = None  # makes sure it doesn't break on None
354
    test.var = None  # makes sure it doesn't break on None
355 355
    test.store()
356 356

  
357 357
    assert len(Foobar.select()) == 50
358 358

  
359
    assert [int(x.id) for x in Foobar.select([st.ILike('foo', 'bar')], order_by='id')] == list(range(21, 50))
360
    assert [int(x.id) for x in Foobar.select([st.ILike('foo', 'BAR')], order_by='id')] == list(range(21, 50))
359
    assert [int(x.id) for x in Foobar.select([st.ILike('var', 'bar')], order_by='id')] == list(range(21, 50))
360
    assert [int(x.id) for x in Foobar.select([st.ILike('var', 'BAR')], order_by='id')] == list(range(21, 50))
361 361

  
362 362

  
363 363
def test_store_async():
364
-