Skip to content

Commit

Permalink
update filter to "pg" project (#26)
Browse files Browse the repository at this point in the history
* update filter to "pg" project

* add test case

* patch test case

* patch test case

Co-authored-by: Aleksandr Malikov <[email protected]>
  • Loading branch information
malikov-pro and Aleksandr Malikov authored Mar 11, 2022
1 parent 9c7dd1e commit 9eca2ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion downloader/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
const (
Platform83Project = "Platform83"
EDTProject = "DevelopmentTools10"
PostgreSQLProject = "AddCompPostgre"
)
const (
x64re = "(?smU)(?:64-bit|64 бит).*"
Expand Down Expand Up @@ -44,7 +45,7 @@ var (
"edt": EDTProject,
"ring": "EnterpriseLicenseTools",
"executor": "Executor",
"pg": "AddCompPostgres",
"pg": PostgreSQLProject,
}

shortFilters = map[string]string{
Expand Down Expand Up @@ -96,6 +97,8 @@ func NewFileFilter(project string, filter string) (FileFilter, error) {
switch project {
case Platform83Project:
return newPlatformMatchFilter(filter)
case PostgreSQLProject:
return newPlatformMatchFilter(filter)
case EDTProject:
return newEdtFilter(filter)
default:
Expand Down
26 changes: 26 additions & 0 deletions downloader/oneDownloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,32 @@ func Test_filterReleaseFiles(t *testing.T) {
},
},
1,
}, {
"PosqtreSQL with 14.1-2.1C",
args{
list: []ReleaseFileInfo{
{
"Дистрибутив СУБД PostgreSQL для Windows (64-bit) одним архивом",
"/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_x64.zip",
}, {
"Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) одним архивом (RPM)",
"/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_x86_64_rpm.tar.bz2",
}, {
"Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) (дополнительные модули) одним архивом (RPM)",
"/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_x86_64_addon_rpm.tar.bz2",
}, {
"Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) одним архивом (DEB)",
"/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_amd64_deb.tar.bz2",
}, {
"Дистрибутив СУБД PostgreSQL для Linux x86 (64-bit) (дополнительные модули) одним архивом (DEB)",
"/version_file?nick=AddCompPostgre&ver=14.1-2.1C&path=AddCompPostgre%5c14_1_2_1C%5cpostgresql_14.1_2.1C_amd64_addon_deb.tar.bz2",
},
},
filters: []FileFilter{
NewFileFilterMust(PostgreSQLProject, "[email protected]"),
},
},
2,
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 9eca2ad

Please sign in to comment.