Skip to content
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

Fix callback issues #59

Merged
merged 10 commits into from
Apr 27, 2018

Conversation

Lycopersicum
Copy link

This pull request is dedicated for issue #44

@Lycopersicum Lycopersicum added the not-as-expected between a bug and an enhancement label Apr 26, 2018
@Lycopersicum Lycopersicum requested a review from GiedriusM April 26, 2018 14:11
@codecov-io
Copy link

codecov-io commented Apr 27, 2018

Codecov Report

Merging #59 into master-rest will decrease coverage by 1.18%.
The diff coverage is 88%.

Impacted file tree graph

@@               Coverage Diff               @@
##           master-rest      #59      +/-   ##
===============================================
- Coverage        80.31%   79.13%   -1.19%     
===============================================
  Files               11       11              
  Lines              813      858      +45     
===============================================
+ Hits               653      679      +26     
- Misses             160      179      +19
Impacted Files Coverage Δ
examples/rest-server/restserver.c 77.46% <100%> (+0.15%) ⬆️
examples/rest-server/rest-notifications.c 98.77% <100%> (+0.32%) ⬆️
examples/rest-server/rest-core.c 58.18% <45.45%> (-39.6%) ⬇️
examples/rest-server/logging.c 86.66% <0%> (+20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58cdef0...086c5bd. Read the comment docs.

{
log_message(LOG_LEVEL_WARN, "Callback \"%s\" is not reachable.\n", callback_url);

u_map_clean(&headers);

Choose a reason for hiding this comment

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

Dvigubas return path'as ir tuo pačiu duplikuotas cleanup kodas - didėja tikimybė ką nors kada nors praleisti. Geriau šitą bloką pakeisti status = false; o funkcijos gale return status;.

@@ -141,6 +190,55 @@ describe('Notifications interface', function () {
});
});

describe('DELETE /notification/callback', function() {

it('should return 204 for existing callback deletion', function(done) {

Choose a reason for hiding this comment

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

Šito ir sekančių testų logiką galima supaprastinti. Testai vykdomi iš eilės, o prieš tai buvo registracijos, todėl čia užtenka tiesiog delete nusiųsti. Sekančiam teste irgi užtenka tiesiog vieno delete.

});
});

it('should return 404 for existing callback deletion', function(done) {

Choose a reason for hiding this comment

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

not existing?

@GiedriusM GiedriusM merged commit 4d2b85c into 8devices:master-rest Apr 27, 2018
@Lycopersicum Lycopersicum deleted the pr-fix-callback-issues branch April 30, 2018 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-as-expected between a bug and an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants