Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
416431c8
Commit
416431c8
authored
Jun 17, 2021
by
Sietse Ringers
Browse files
test: move all nonlocal tests to test files excluded by --tags=local_tests
parent
b1c78e0e
Changes
4
Hide whitespace changes
Inline
Side-by-side
server/keyshare/myirmaserver/postgresdb_test.go
View file @
416431c8
...
...
@@ -120,11 +120,6 @@ func TestPostgresDBLoginToken(t *testing.T) {
},
cand
)
}
var
(
str15
=
"15"
strEmpty
=
""
)
func
TestPostgresDBUserInfo
(
t
*
testing
.
T
)
{
SetupDatabase
(
t
)
defer
TeardownDatabase
(
t
)
...
...
server/keyshare/myirmaserver/server_test.go
View file @
416431c8
...
...
@@ -21,8 +21,13 @@ func init() {
irma
.
Logger
.
SetLevel
(
logrus
.
FatalLevel
)
}
var
(
str15
=
"15"
strEmpty
=
""
)
func
TestServerInvalidMessage
(
t
*
testing
.
T
)
{
myirmaServer
,
httpServer
:=
StartMyIrmaServer
(
t
,
newMemoryDB
(),
"
localhost:1025
"
)
myirmaServer
,
httpServer
:=
StartMyIrmaServer
(
t
,
newMemoryDB
(),
""
)
defer
StopMyIrmaServer
(
t
,
myirmaServer
,
httpServer
)
test
.
HTTPGet
(
t
,
nil
,
"http://localhost:8080/user"
,
nil
,
400
,
nil
)
...
...
server/keyshare/tasks/conf_test.go
deleted
100644 → 0
View file @
b1c78e0e
package
tasks
import
(
"path/filepath"
"testing"
irma
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/test"
"github.com/privacybydesign/irmago/server/keyshare"
"github.com/stretchr/testify/assert"
)
func
TestConfiguration
(
t
*
testing
.
T
)
{
testdataPath
:=
test
.
FindTestdataFolder
(
t
)
err
:=
processConfiguration
(
&
Configuration
{
Logger
:
irma
.
Logger
})
assert
.
NoError
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
DefaultLanguage
:
"en"
,
},
DeleteExpiredAccountFiles
:
map
[
string
]
string
{
"en"
:
filepath
.
Join
(
testdataPath
,
"emailtemplate.html"
),
},
DeleteExpiredAccountSubjects
:
map
[
string
]
string
{
"en"
:
"testsubject"
,
},
Logger
:
irma
.
Logger
,
})
assert
.
NoError
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
},
DeleteExpiredAccountFiles
:
map
[
string
]
string
{
"en"
:
filepath
.
Join
(
testdataPath
,
"emailtemplate.html"
),
},
DeleteExpiredAccountSubjects
:
map
[
string
]
string
{
"en"
:
"testsubject"
,
},
Logger
:
irma
.
Logger
,
})
assert
.
Error
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
DefaultLanguage
:
"en"
,
},
DeleteExpiredAccountSubjects
:
map
[
string
]
string
{
"en"
:
"testsubject"
,
},
Logger
:
irma
.
Logger
,
})
assert
.
Error
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
DefaultLanguage
:
"en"
,
},
DeleteExpiredAccountFiles
:
map
[
string
]
string
{
"en"
:
filepath
.
Join
(
testdataPath
,
"emailtemplate.html"
),
},
Logger
:
irma
.
Logger
,
})
assert
.
Error
(
t
,
err
)
}
server/keyshare/tasks/tasks_test.go
View file @
416431c8
...
...
@@ -128,6 +128,70 @@ func TestExpireAccounts(t *testing.T) {
assert
.
Equal
(
t
,
1
,
countRows
(
t
,
db
,
"users"
,
"delete_on IS NOT NULL"
))
}
func
TestConfiguration
(
t
*
testing
.
T
)
{
testdataPath
:=
test
.
FindTestdataFolder
(
t
)
err
:=
processConfiguration
(
&
Configuration
{
Logger
:
irma
.
Logger
})
assert
.
NoError
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
DefaultLanguage
:
"en"
,
},
DeleteExpiredAccountFiles
:
map
[
string
]
string
{
"en"
:
filepath
.
Join
(
testdataPath
,
"emailtemplate.html"
),
},
DeleteExpiredAccountSubjects
:
map
[
string
]
string
{
"en"
:
"testsubject"
,
},
Logger
:
irma
.
Logger
,
})
assert
.
NoError
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
},
DeleteExpiredAccountFiles
:
map
[
string
]
string
{
"en"
:
filepath
.
Join
(
testdataPath
,
"emailtemplate.html"
),
},
DeleteExpiredAccountSubjects
:
map
[
string
]
string
{
"en"
:
"testsubject"
,
},
Logger
:
irma
.
Logger
,
})
assert
.
Error
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
DefaultLanguage
:
"en"
,
},
DeleteExpiredAccountSubjects
:
map
[
string
]
string
{
"en"
:
"testsubject"
,
},
Logger
:
irma
.
Logger
,
})
assert
.
Error
(
t
,
err
)
err
=
processConfiguration
(
&
Configuration
{
EmailConfiguration
:
keyshare
.
EmailConfiguration
{
EmailServer
:
"localhost:1025"
,
EmailFrom
:
"test@test.com"
,
DefaultLanguage
:
"en"
,
},
DeleteExpiredAccountFiles
:
map
[
string
]
string
{
"en"
:
filepath
.
Join
(
testdataPath
,
"emailtemplate.html"
),
},
Logger
:
irma
.
Logger
,
})
assert
.
Error
(
t
,
err
)
}
func
SetupDatabase
(
t
*
testing
.
T
)
{
test
.
RunScriptOnDB
(
t
,
"../cleanup.sql"
,
true
)
test
.
RunScriptOnDB
(
t
,
"../schema.sql"
,
false
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment