Skip to content

Commit 77e21a4

Browse files
committed
Add test pkg
1 parent 7e24f67 commit 77e21a4

File tree

2 files changed

+118
-110
lines changed

2 files changed

+118
-110
lines changed

bench_test.go

Lines changed: 4 additions & 110 deletions
Large diffs are not rendered by default.

test/real_world/real_world.go

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
package real_world
2+
3+
type DirectFlightsDays struct {
4+
Start string
5+
Days string
6+
}
7+
8+
type RouteSegment struct {
9+
Origin string
10+
OriginName string
11+
Destination string
12+
DestinationName string
13+
Date string
14+
OriginCountry string
15+
DestinationCountry string
16+
TranslatedOrigin string
17+
TranslatedDestination string
18+
UserOrigin string
19+
UserDestination string
20+
DirectFlightsDays *DirectFlightsDays
21+
}
22+
23+
type Passengers struct {
24+
Adults uint32
25+
Children uint32
26+
Infants uint32
27+
}
28+
29+
type UserAgentFeatures struct {
30+
Assisted bool
31+
TopPlacement bool
32+
TourTickets bool
33+
}
34+
35+
type SearchParamsEnv struct {
36+
Segments []*RouteSegment
37+
OriginCountry string
38+
DestinationCountry string
39+
SearchDepth int
40+
Passengers *Passengers
41+
TripClass string
42+
UserIP string
43+
KnowEnglish bool
44+
Market string
45+
Marker string
46+
CleanMarker string
47+
Locale string
48+
ReferrerHost string
49+
CountryCode string
50+
CurrencyCode string
51+
IsOpenJaw bool
52+
Os string
53+
OsVersion string
54+
AppVersion string
55+
IsAffiliate bool
56+
InitializedAt int64
57+
Random float32
58+
TravelPayoutsAPI bool
59+
Features *UserAgentFeatures
60+
GateID int32
61+
UserAgentDevice string
62+
UserAgentType string
63+
IsDesktop bool
64+
IsMobile bool
65+
}
66+
67+
type Env struct {
68+
SearchParamsEnv
69+
}
70+
71+
func NewEnv() Env {
72+
return Env{
73+
SearchParamsEnv: SearchParamsEnv{
74+
Segments: []*RouteSegment{
75+
{
76+
Origin: "VOG",
77+
Destination: "SHJ",
78+
},
79+
{
80+
Origin: "SHJ",
81+
Destination: "VOG",
82+
},
83+
},
84+
OriginCountry: "RU",
85+
DestinationCountry: "RU",
86+
SearchDepth: 44,
87+
Passengers: &Passengers{1, 0, 0},
88+
TripClass: "Y",
89+
UserIP: "::1",
90+
KnowEnglish: true,
91+
Market: "ru",
92+
Marker: "123456.direct",
93+
CleanMarker: "123456",
94+
Locale: "ru",
95+
ReferrerHost: "www.aviasales.ru",
96+
CountryCode: "",
97+
CurrencyCode: "usd",
98+
IsOpenJaw: false,
99+
Os: "",
100+
OsVersion: "",
101+
AppVersion: "",
102+
IsAffiliate: true,
103+
InitializedAt: 1570788719,
104+
Random: 0.13497187,
105+
TravelPayoutsAPI: false,
106+
Features: &UserAgentFeatures{},
107+
GateID: 421,
108+
UserAgentDevice: "DESKTOP",
109+
UserAgentType: "WEB",
110+
IsDesktop: true,
111+
IsMobile: false,
112+
},
113+
}
114+
}

0 commit comments

Comments
 (0)