Пример #1
0
    def test_primes(self):
        with open('tests/data_primes.json') as file:
            data = json.load(file)

        p = iter(primes())
        for prime in data:
            self.assertEqual(next(p), prime)
Пример #2
0
    def test_primes(self):
        with open('tests/data_primes.json') as file:
            data = json.load(file)

        p = iter(primes())
        for prime in data:
            self.assertEqual(next(p), prime)
Пример #3
0
def test_primes():
    with open('tests/data_primes.json') as file:
        data = json.load(file)

    p = iter(primes())
    for prime in data:
        assert next(p) == prime
Пример #4
0
def test_primes():
    with open('tests/data_primes.json') as file:
        data = json.load(file)

    p = iter(primes())
    for prime in data:
        assert next(p) == prime
Пример #5
0
 def test_is_generator(self):
     gen = primes()
     self.assertIn('__init__', dir(gen))
     self.assertIn('__next__', dir(gen))
Пример #6
0
 def test_is_generator(self):
     gen = primes()
     self.assertIn('__init__', dir(gen))
     self.assertIn('__next__', dir(gen))
Пример #7
0
def test_primes_is_iterable():
    gen = primes()
    assert '__init__' in dir(gen)
    assert '__next__' in dir(gen)
Пример #8
0
def test_primes_is_iterable():
    gen = primes()
    assert '__init__' in dir(gen)
    assert '__next__' in dir(gen)