Code Monkey home page Code Monkey logo

Comments (6)

csnewman avatar csnewman commented on July 2, 2024 1

I agree with this course of action.

I would suggest you add the "help-wanted" or/and "up-for-grabs" labels onto this issue

from lecture-hoarder.

ed-cooper avatar ed-cooper commented on July 2, 2024

I considered this, but I wasn't sure whether it would be worth the time spent refactoring for how little changes will probably be made from this point onwards.

Plus we'd probably need a username and password combination for running tests with? (Unless you mean only doing tests locally with supplied usernames?)

from lecture-hoarder.

csnewman avatar csnewman commented on July 2, 2024

I see two main approaches forward:

  1. A fake http server that will return cached results from the official server (but slightly edited of course)

  2. Separating out the web requests into their own object, and just stubbing that object when testing the rest of the logic

from lecture-hoarder.

ed-cooper avatar ed-cooper commented on July 2, 2024

The HTML parsing is one of the most important parts of the logic imo, and probably the easiest to break.

Therefore the HTTP server would be the way forwards.

It would be easy enough to introduce variables for the https://login.manchester.ac.uk/ and https://video.manchester.ac.uk/ base URLs, which could then be changed for testing purposes.

But trying to create a semi-accurate web server is more effort than I'd want to do, so I'd be leaving it up to you to implement.

from lecture-hoarder.

ed-cooper avatar ed-cooper commented on July 2, 2024

The login and video URLs are now exposed in the settings, so theoretically setup with a fake HTTP server would now be possible

from lecture-hoarder.

ed-cooper avatar ed-cooper commented on July 2, 2024

Abstraction of web requests has been completed, now a unit testing setup with dependency injection can be implemented

from lecture-hoarder.

Related Issues (20)

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.