mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-16 01:28:48 +02:00
test:#68 fix test
This commit is contained in:
@ -69,7 +69,7 @@ func FetchAndParse(season, label string) (model.SeminarGroup, error) {
|
||||
if err != nil {
|
||||
return model.SeminarGroup{}, err
|
||||
}
|
||||
return parseSeminarGroup(result, season), nil
|
||||
return parseSeminarGroup(result), nil
|
||||
}
|
||||
|
||||
func SplitEventType(events []model.Event) ([]model.Event, error) {
|
||||
@ -90,7 +90,7 @@ func SplitEventType(events []model.Event) ([]model.Event, error) {
|
||||
return events, nil
|
||||
}
|
||||
|
||||
func parseSeminarGroup(result string, semester string) model.SeminarGroup {
|
||||
func parseSeminarGroup(result string) model.SeminarGroup {
|
||||
doc, err := html.Parse(strings.NewReader(result))
|
||||
if err != nil {
|
||||
fmt.Printf("Error occurred while parsing the HTML document: %s\n", err.Error())
|
||||
|
@ -593,8 +593,7 @@ func TestIsWinterSemester(t *testing.T) {
|
||||
|
||||
func Test_parseSeminarGroup(t *testing.T) {
|
||||
type args struct {
|
||||
result string
|
||||
semester string
|
||||
result string
|
||||
}
|
||||
|
||||
//read string from fil
|
||||
@ -613,8 +612,7 @@ func Test_parseSeminarGroup(t *testing.T) {
|
||||
{
|
||||
name: "Test 1",
|
||||
args: args{
|
||||
result: htmlString,
|
||||
semester: "ws",
|
||||
result: htmlString,
|
||||
},
|
||||
want: model.SeminarGroup{
|
||||
Course: "23SAM",
|
||||
@ -838,7 +836,7 @@ func Test_parseSeminarGroup(t *testing.T) {
|
||||
|
||||
//sort Arrays by StartDate
|
||||
sortEventsByStartDate(tt.want.Events)
|
||||
got := parseSeminarGroup(tt.args.result, tt.args.semester)
|
||||
got := parseSeminarGroup(tt.args.result)
|
||||
sortEventsByStartDate(got.Events)
|
||||
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
|
Reference in New Issue
Block a user