Fix lint errors
This commit is contained in:
parent
3d289ed5f0
commit
876f617876
@ -21,6 +21,7 @@ type SpyResult struct {
|
|||||||
type FakeDownloader struct {
|
type FakeDownloader struct {
|
||||||
Spy *[]SpyResult
|
Spy *[]SpyResult
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFakeDownloader() FakeDownloader {
|
func NewFakeDownloader() FakeDownloader {
|
||||||
ret := FakeDownloader{}
|
ret := FakeDownloader{}
|
||||||
ret.Spy = &[]SpyResult{}
|
ret.Spy = &[]SpyResult{}
|
||||||
@ -39,7 +40,6 @@ func (d FakeDownloader) Contains(result SpyResult) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func test_all_downloaded(tweet scraper.Tweet, yes_or_no bool, t *testing.T) {
|
func test_all_downloaded(tweet scraper.Tweet, yes_or_no bool, t *testing.T) {
|
||||||
error_msg := map[bool]string{
|
error_msg := map[bool]string{
|
||||||
true: "Expected to be downloaded, but it wasn't",
|
true: "Expected to be downloaded, but it wasn't",
|
||||||
@ -116,8 +116,14 @@ func TestDownloadUserContent(t *testing.T) {
|
|||||||
|
|
||||||
// Check that the downloader was called with the appropriate stuff
|
// Check that the downloader was called with the appropriate stuff
|
||||||
assert.Len(*fake_downloader.Spy, 2)
|
assert.Len(*fake_downloader.Spy, 2)
|
||||||
assert.True(fake_downloader.Contains(SpyResult{"profile image url", "test_profiles/TestMediaQueries/profile_images/profile image local path"}))
|
assert.True(fake_downloader.Contains(SpyResult{
|
||||||
assert.True(fake_downloader.Contains(SpyResult{"banner image url", "test_profiles/TestMediaQueries/profile_images/banner image local path"}))
|
"profile image url",
|
||||||
|
"test_profiles/TestMediaQueries/profile_images/profile image local path",
|
||||||
|
}))
|
||||||
|
assert.True(fake_downloader.Contains(SpyResult{
|
||||||
|
"banner image url",
|
||||||
|
"test_profiles/TestMediaQueries/profile_images/banner image local path",
|
||||||
|
}))
|
||||||
|
|
||||||
// The User should now be marked "yes downloaded"
|
// The User should now be marked "yes downloaded"
|
||||||
assert.True(user.IsContentDownloaded)
|
assert.True(user.IsContentDownloaded)
|
||||||
@ -148,5 +154,8 @@ func TestDownloadDefaultUserContent(t *testing.T) {
|
|||||||
|
|
||||||
// Check that the downloader was called with the appropriate stuff
|
// Check that the downloader was called with the appropriate stuff
|
||||||
assert.Len(*fake_downloader.Spy, 1)
|
assert.Len(*fake_downloader.Spy, 1)
|
||||||
assert.True(fake_downloader.Contains(SpyResult{scraper.DEFAULT_PROFILE_IMAGE_URL, "test_profiles/TestMediaQueries/profile_images/default_profile.png"}))
|
assert.True(fake_downloader.Contains(SpyResult{
|
||||||
|
scraper.DEFAULT_PROFILE_IMAGE_URL,
|
||||||
|
"test_profiles/TestMediaQueries/profile_images/default_profile.png",
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user