-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gRPCServerTest] gRPS server implemented #24
base: master
Are you sure you want to change the base?
Conversation
goodTemplate: []byte(`<html><body><h1 style="color:red;">Test html color<h1> | ||
<p>{{.CourseName}}</p><p>{{.CourseType}}</p><p>{{.CourseHours}}</p><p>{{.CourseDate}}</p> | ||
<p>{{.CourseMentors}}</p><p>{{.StudentFirstname}}</p><p>{{.StudentLastname}}</p> | ||
</body></html>`), | ||
failTemplate: []byte(`<html><body><h1 style="color:red;">Test html color<h1> | ||
<p>{{.CourseName_Fail}}</p></body></html>`), | ||
expected: []byte(`<html><body><h1 style="color:red;">Test html color<h1> | ||
expectedCert: []byte(`<html><body><h1 style="color:red;">Test html color<h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что-то не обратил внимания раньше. Тут по-хорошему должен быть failObject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут не понял. Почему должен failObject? Наоборот expectedCert это образец сертификата который должен сгенерироваться.
@@ -52,7 +54,36 @@ func TestGenerateCertificate(t *testing.T) { | |||
t.Error(err) | |||
} | |||
|
|||
if !reflect.DeepEqual(gotCertif, testData.expected) { | |||
if !reflect.DeepEqual(gotCertif, testData.expectedCert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Опять же - лучше использовать какой-либо testify. Но это нужно было сделать раньше, сейчас можно отдельную таску.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
переделать все тесты под testify?
|
||
func TestGenerateID(t *testing.T) { | ||
generator := testData.certGenerator | ||
_, err := generator.GenerateCertHTML(testData.goodTemplate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мы не должны проверять работу генератора сертификата в тесте генератора ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
@@ -4,7 +4,7 @@ import ( | |||
"gus_certificates/utils/storage/local" | |||
) | |||
|
|||
type storage interface { | |||
type Storage interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
CS-15
What:
Реализована работа gRPC сервера.
Why:
Для получения и отправки запросов RPC.
How:
Добавлена инструкция по запуску сервера в файл README.md
Добавлен файл для генерации вспомогательных gRPC файлов protoc_options_generate.txt
Добавлен cmd/rpc/main.go для запуска RPC сервера.
Добавлена реализация функций сервера в файл app/server/server.go
В генератор сертификатов app/certgenerator/certgenerator.go добавлено 2 метода:
GenerateID - генерация ID/имени сертификата.
ValidateData - валидация входных данных по студенту и курсу.
Обновлены тесты.