<s> from pypi_portal . extensions import db <EOL> from pypi_portal . models . helpers import count <EOL> from pypi_portal . models . pypi import Package <EOL> def test_count ( ) : <EOL> Package . query . delete ( ) <EOL> db . session . commit ( ) <EOL> assert <NUM_LIT:0> == count ( Package . name , '<STR_LIT>' ) <EOL> assert <NUM_LIT:0> == count ( Package . name , '<STR_LIT:%>' ) <EOL> assert <NUM_LIT:0> == count ( Package . name , '<STR_LIT:%>' , True ) <EOL> db . session . add ( Package ( name = '<STR_LIT>' , summary = '<STR_LIT>' , latest_version = '<STR_LIT>' ) ) <EOL> db . session . commit ( ) <EOL> assert <NUM_LIT:0> == count ( Package . name , '<STR_LIT:%>' ) <EOL> assert <NUM_LIT:1> == count ( Package . name , '<STR_LIT:%>' , True ) <EOL> db . session . add ( Package ( name = '<STR_LIT>' , summary = '<STR_LIT>' , latest_version = '<STR_LIT>' ) ) <EOL> db . session . commit ( ) <EOL> assert <NUM_LIT:0> == count ( Package . name , '<STR_LIT>' ) <EOL> assert <NUM_LIT:1> == count ( Package . name , '<STR_LIT>' ) <EOL> assert <NUM_LIT:0> == count ( Package . name , '<STR_LIT>' ) <EOL> assert <NUM_LIT:2> == count ( Package . name , '<STR_LIT>' , True ) </s>
