Skip to content

Commit

Permalink
Fix Django tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Jun 27, 2024
1 parent d2a895d commit 43a80df
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions platformifier/django_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *PlatformifyDjangoSuiteTester) TestSuccessfulFileCreation() {
// AND the settings.py file exists
s.fileSystem.EXPECT().
Find("", settingsPyFile, true).
Return([]string{settingsPyFile}).Times(2)
Return([]string{settingsPyFile}).Times(1)
s.fileSystem.EXPECT().
Open(gomock.Eq(settingsPyFile), gomock.Any(), gomock.Any()).
Return(settingsBuff, nil).Times(1)
Expand Down Expand Up @@ -88,11 +88,7 @@ func (s *PlatformifyDjangoSuiteTester) TestSettingsFileNotFound() {
// AND the settings.py file doesn't exist
s.fileSystem.EXPECT().
Find("", settingsPyFile, true).
Return([]string{}).Times(2)
// AND creation of the PSH settings file returns no errors
s.fileSystem.EXPECT().
Create(gomock.Eq(settingsPshPyFile)).
Return(buff, nil).Times(1)
Return([]string{}).Times(1)

// WHEN run config files creation
p := newDjangoPlatformifier(s.templates, s.fileSystem)
Expand All @@ -109,7 +105,7 @@ func (s *PlatformifyDjangoSuiteTester) TestPSHSettingsFileCreationError() {
// AND the settings.py file exists
s.fileSystem.EXPECT().
Find("", settingsPyFile, true).
Return([]string{settingsPyFile}).Times(2)
Return([]string{settingsPyFile}).Times(1)
// AND creating PSH settings file fails
s.fileSystem.EXPECT().
Create(gomock.Eq(settingsPshPyFile)).
Expand Down

0 comments on commit 43a80df

Please sign in to comment.