RowFixture Acceptance Tests

These tests only cover PyFit specific behavior, they do not cover behavior which is, or should be, common to all versions of FIT. See the fat directory and the FitLibrary specification tests for common behavior.

 

Multiple Object Types in List Collection

 

All of the collection verification fixtures should take any object (including dictionaries) which has the requested attributes.

First, we build a list

fit.AccTestFixtures.RowFixtureAT.ListBuilder
new collectionlist
new objectobject1
attributea1one
attributea21
new objectobject2
attributea1two
attributea22
new objectdict
attributea1three
attributea23
set symbol

then we check that it contains what it is supposed to

fitLib.FixtureFixture
fixturefit.AccTestFixtures.RowFixtureAT
 a1a2
rrone1
rrtwo2
rrthree3

 

Multiple Object Types in Tuple Collection

 

We do the same thing, but this time returning a tuple as the collection. We're also going to juggle the order of the elements, just to see if that does anything

First, we build a list

fit.AccTestFixtures.RowFixtureAT.ListBuilder
new collectiontuple
new objectdict
attributea1one
attributea21
new objectobject1
attributea1three
attributea23
new objectobject2
attributea1two
attributea22
set symbol

then we check that it contains what it is supposed to

fitLib.FixtureFixture
fixturefit.AccTestFixtures.RowFixtureAT
 a1a2
rrone1
rrtwo2
rrthree3

 

Multiple Object Types in a Dictionary

 

We do the same thing, but this time returning a dictionary as the collection. We're also going to juggle the order of the elements, just to see if that does anything.

First, we build the collection

fit.AccTestFixtures.RowFixtureAT.ListBuilder
new collectiondict
new objectdict1
attributea1one
attributea21
new objectobject12
attributea1three
attributea23
new objectobject23
attributea1two
attributea22
set symbol
then we check that it contains what it is supposed to

fitLib.FixtureFixture
fixturefit.AccTestFixtures.RowFixtureAT
 a1a2
rrone1
rrtwo2
rrthree3

 

Missing Metadata For Column

 

We remove the metadata for one of the columns.

fit.AccTestFixtures.RowFixtureAT.ListBuilder
new collectiondict
new objectdict1
attributea1one
attributea21
attributeGermanein
new objectobject12
attributea1three
attributea23
attributeGermandrei
new objectobject23
attributea1two
attributea22
attributeGermanzwei
remove metadataGerman
set symbol
then we check that it contains what it is supposed to

fitLib.FixtureFixture
fixturefit.AccTestFixtures.RowFixtureAT
-ea1Germana2
rwronefie1
rwrtwofi2
rwrthreefo3

 

Column not in any object

 

We change the column name.

fitLib.FixtureFixture
fixturefit.AccTestFixtures.RowFixtureAT
-ea1germana2
 onefie1
 twofi2
 threefo3

 

Row Fixture With Parameter

 

We can invoke the fit.RowFixture without a subclass by specifying a symbol.

fit.AccTestFixtures.RowFixtureAT.ListBuilder
new collectionlist
new objectobject1
attributea1one
attributea21
new objectobject2
attributea1two
attributea22
new objectdict
attributea1three
attributea23
set symbolaSymbol

 

fitLib.FixtureFixture
fixturefit.RowFixtureaSymbol
 a1a2
rrone1
rrtwo2
rrthree3

 

Row Fixture With Undefined Parameter

 

The symbol doesn't exist in the table

 

fitLib.SpecifyFixture
fit.RowFixturewrongSymbol
a1a2
one1
two2
three3
fit.RowFixturewrongSymbol
Parameter 'wrongSymbol' to Row Fixture was not defined by prior fixture.
a1a2
one1
two2
three3