Make Space test fixture semi-stable based on given ID
This commit is contained in:
parent
1b675e8200
commit
3b6c970b74
@ -286,7 +286,7 @@ func TestSaveAndLoadSpace(t *testing.T) {
|
|||||||
profile_path := "test_profiles/TestMediaQueries"
|
profile_path := "test_profiles/TestMediaQueries"
|
||||||
profile := create_or_load_profile(profile_path)
|
profile := create_or_load_profile(profile_path)
|
||||||
|
|
||||||
space := create_dummy_space()
|
space := create_space_from_id(rand.Int())
|
||||||
err := profile.SaveSpace(space)
|
err := profile.SaveSpace(space)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
||||||
|
@ -290,9 +290,12 @@ func create_dummy_retweet(tweet_id scraper.TweetID) scraper.Retweet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func create_dummy_space() scraper.Space {
|
/**
|
||||||
|
* Create a semi-stable Space given an ID
|
||||||
|
*/
|
||||||
|
func create_space_from_id(id int) scraper.Space {
|
||||||
return scraper.Space{
|
return scraper.Space{
|
||||||
ID: scraper.SpaceID(fmt.Sprintf("some_id_%d", rand.Int())),
|
ID: scraper.SpaceID(fmt.Sprintf("some_id_%d", id)),
|
||||||
ShortUrl: fmt.Sprintf("short_url_%d", rand.Int()),
|
ShortUrl: fmt.Sprintf("short_url_%d", id),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user