GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Evan Prodromou (evan@cosocial.ca)'s status on Monday, 13-Nov-2023 11:54:04 JST Evan Prodromou Evan Prodromou

    I've been working on the command-line API client, ap, for the ActivityPub book I'm writing for O'Reilly Media. It's a Python program that implements commands like `ap inbox` (read the inbox) and `ap reject follower` (reject a pending follower).

    Originally, I was testing it live, just running it against onepage.pub. This weekend, I buckled down and wrote real unit tests with unittest.mock. It's been amazing; what a great tool.

    In conversation Monday, 13-Nov-2023 11:54:04 JST from cosocial.ca permalink
    • esmevane, sorry repeated this.
    • Embed this notice
      Evan Prodromou (evan@cosocial.ca)'s status on Monday, 13-Nov-2023 11:57:24 JST Evan Prodromou Evan Prodromou
      in reply to

      I've been able to mock behaviour very much at the outer boundaries of the app, like:

      - Faking command-line options
      - Faking the data in the user's token file
      - Faking HTTP GET requests for actors, streams, and objects
      - Faking HTTP POST requests to create new activities
      - Faking user input

      Overall, it's been a really fun, interesting process. I had ~20 commands programmed with no tests, and I've been able to add tests for almost all of them in less than a day of coding.

      In conversation Monday, 13-Nov-2023 11:57:24 JST permalink
    • Embed this notice
      Evan Prodromou (evan@cosocial.ca)'s status on Monday, 13-Nov-2023 12:01:19 JST Evan Prodromou Evan Prodromou
      in reply to

      https://docs.python.org/3/library/unittest.mock.html

      In conversation Monday, 13-Nov-2023 12:01:19 JST permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: docs.python.org
        unittest.mock — mock object library
        from ../about.html
        Source code: Lib/unittest/mock.py unittest.mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they hav...
    • Embed this notice
      Nathan Schneider (ntnsndr@social.coop)'s status on Monday, 13-Nov-2023 13:22:54 JST Nathan Schneider Nathan Schneider
      in reply to

      @evan This is a manual I want on my bedside table. Can't wait!

      In conversation Monday, 13-Nov-2023 13:22:54 JST permalink
    • Embed this notice
      Evan Prodromou (evan@cosocial.ca)'s status on Monday, 13-Nov-2023 14:45:44 JST Evan Prodromou Evan Prodromou
      in reply to
      • Justin Thomas 🛡

      @justin cool. We should check for interoperability. Also, cool URL.

      In conversation Monday, 13-Nov-2023 14:45:44 JST permalink
    • Embed this notice
      Justin Thomas 🛡 (justin@ser.endipito.us)'s status on Monday, 13-Nov-2023 14:45:45 JST Justin Thomas 🛡 Justin Thomas 🛡
      in reply to

      @evan I've been building something in the same vein in Rust for my own testing: https://gitlab.com/justindthomas/sofapub

      In conversation Monday, 13-Nov-2023 14:45:45 JST permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: gitlab.com
        Justin Thomas / SofaPub · GitLab
        GitLab.com

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.