Giter Site home page Giter Site logo

location-api's Introduction

location-api

Build Status

This is a simple API written in Go to store and retrieve location objects in MongoDB.

location-api's People

Contributors

billglover avatar

Watchers

 avatar James Cloos avatar  avatar

location-api's Issues

The GET method is handled but also marked as not implemented

The GET method for /locations is handled on line 31.

    // the following methods have been implemented
    api.Get("/location", handlers.GetLocation)

However it is also marked as not implemented on line 34.

    // the following methods are not implemented
    api.Get("/location", handlers.NotImplemented)

Many thanks to an anonymous GitHub user for reporting this.

Test fail following the limitation to in-day responses for GET requests

When GET /locations responses were limited to only return the results from the current day this meant that automated tests are now failing. Test data isn't available for the current day.

Two potential options for addressing this:

  • create test data as the tests run
  • make the in-day limitation an optional parameter

Not enough test data to support pagination tests

Build is failing as there is not enough data to support the pagination tests.

--- FAIL: TestAll (0.01s)
    Error Trace:    main_test.go:111
    Error:      Not equal: 1 (expected)
                    != 0 (actual)
    Messages:   GET /locations?page=2&per_page=1 
            unexpected number of objects returned

Pagination handling has no test coverage

Current test coverage does not test whether the following queries return the correct response in all cases

GET http://localhost:8080/locations?page=0&per_page=2
GET http://localhost:8080/locations?per_page=2
GET http://localhost:8080/locations?page=2

Tests should be written to cover pagination query parameters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.