Skip to content

Conversation

@amuschtagow
Copy link
Contributor

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 - валидация входных данных по студенту и курсу.
Обновлены тесты.

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то не обратил внимания раньше. Тут по-хорошему должен быть failObject

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут не понял. Почему должен failObject? Наоборот expectedCert это образец сертификата который должен сгенерироваться.

}

if !reflect.DeepEqual(gotCertif, testData.expected) {
if !reflect.DeepEqual(gotCertif, testData.expectedCert) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Опять же - лучше использовать какой-либо testify. Но это нужно было сделать раньше, сейчас можно отдельную таску.

Copy link
Contributor Author

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мы не должны проверять работу генератора сертификата в тесте генератора ID

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил

)

type storage interface {
type Storage interface {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants