# -*- coding: utf-8 -*-
import pytest
from services.PrimeService import PrimeService
@pytest.fixture
def service():
service = PrimeService()
return service
@pytest.mark.usefixtures()
class TestPrimeService:
# Positive Happy Path Tests
def test_get_single_prime( self, service ):
PrimeService( start= 0 )
def test_one( self, service ):
r = service.slow_primes()
print r
# Performance Tests
#TODO: pick a big O notation based input sizes to gaurantee basic performance bounds
# Negative Error Tests
def test_zero_gets_an_exception( self, service ):
with pytest.raises( ValueError ):
PrimeService( start= 0 )
def test_negative_gets_an_exception( self, service ):
with pytest.raises( ValueError ):
PrimeService( start= -1 )