Correct tests

This commit is contained in:
Aaron L 2016-08-23 23:28:49 -07:00
parent 28e485603a
commit 113f8be521
2 changed files with 6 additions and 5 deletions

View file

@ -59,15 +59,15 @@ func (m *MockDriver) Columns(tableName string) ([]bdb.Column, error) {
func (m *MockDriver) ForeignKeyInfo(tableName string) ([]bdb.ForeignKey, error) { func (m *MockDriver) ForeignKeyInfo(tableName string) ([]bdb.ForeignKey, error) {
return map[string][]bdb.ForeignKey{ return map[string][]bdb.ForeignKey{
"jets": { "jets": {
{Name: "jets_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, {Table: "jets", Name: "jets_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"},
{Name: "jets_airport_id_fk", Column: "airport_id", ForeignTable: "airports", ForeignColumn: "id"}, {Table: "jets", Name: "jets_airport_id_fk", Column: "airport_id", ForeignTable: "airports", ForeignColumn: "id"},
}, },
"licenses": { "licenses": {
{Name: "licenses_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, {Table: "licenses", Name: "licenses_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"},
}, },
"pilot_languages": { "pilot_languages": {
{Name: "pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, {Table: "pilot_languages", Name: "pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"},
{Name: "jet_id_fk", Column: "language_id", ForeignTable: "languages", ForeignColumn: "id"}, {Table: "pilot_languages", Name: "jet_id_fk", Column: "language_id", ForeignTable: "languages", ForeignColumn: "id"},
}, },
}[tableName], nil }[tableName], nil
} }

View file

@ -59,6 +59,7 @@ func TestTextsFromOneToOneRelationship(t *testing.T) {
expect := RelationshipToOneTexts{} expect := RelationshipToOneTexts{}
expect.ForeignKey = bdb.ForeignKey{ expect.ForeignKey = bdb.ForeignKey{
Table: "jets",
Name: "none", Name: "none",
Column: "id", Column: "id",
Nullable: false, Nullable: false,