mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
test: add further tests for heartbeat augmentation (resolve #144)
This commit is contained in:
@ -26,17 +26,24 @@ func TestHeartbeat_Valid_MissingUser(t *testing.T) {
|
||||
|
||||
func TestHeartbeat_Augment(t *testing.T) {
|
||||
testMappings := map[string]string{
|
||||
"py": "Python3",
|
||||
"py": "Python3",
|
||||
"foo": "Foo Script",
|
||||
"blade.php": "Blade",
|
||||
}
|
||||
|
||||
sut := &Heartbeat{
|
||||
sut1, sut2 := &Heartbeat{
|
||||
Entity: "~/dev/file.py",
|
||||
Language: "Python",
|
||||
}, &Heartbeat{
|
||||
Entity: "~/dev/file.blade.php",
|
||||
Language: "unknown",
|
||||
}
|
||||
|
||||
sut.Augment(testMappings)
|
||||
sut1.Augment(testMappings)
|
||||
sut2.Augment(testMappings)
|
||||
|
||||
assert.Equal(t, "Python3", sut.Language)
|
||||
assert.Equal(t, "Python3", sut1.Language)
|
||||
assert.Equal(t, "Blade", sut2.Language)
|
||||
}
|
||||
|
||||
func TestHeartbeat_GetKey(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user