john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

prime service test incomplete

# -*- 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 )

  • « prime service incomplete
  • kth smallest »

Published

May 24, 2013

Category

python

~76 words

Tags

  • incomplete 22
  • prime 2
  • python 180
  • service 12
  • test 29