Vendoring octorest
This commit is contained in:
parent
3275563a18
commit
bee6f3b69a
76 changed files with 13557 additions and 0 deletions
21
projects/octorest/.gitignore
vendored
Normal file
21
projects/octorest/.gitignore
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
*.py[cod]
|
||||
*.sw[po]
|
||||
*.gcode
|
||||
*.gco
|
||||
|
||||
# Packages
|
||||
*.egg
|
||||
*.egg-info
|
||||
.eggs
|
||||
dist
|
||||
build
|
||||
sdist
|
||||
|
||||
# Testmon
|
||||
.testmondata
|
||||
|
||||
# VS Code
|
||||
.vscode
|
||||
|
||||
# Environments
|
||||
env/
|
11
projects/octorest/BUILD.bazel
Normal file
11
projects/octorest/BUILD.bazel
Normal file
|
@ -0,0 +1,11 @@
|
|||
package(default_visibility=["//visibility:public"])
|
||||
|
||||
py_library(
|
||||
name = "octorest",
|
||||
imports = ["src"],
|
||||
srcs = glob(["src/**/*"]),
|
||||
deps = [
|
||||
py_requirement('requests'),
|
||||
py_requirement('websocket-client'),
|
||||
]
|
||||
)
|
25
projects/octorest/LICENSE
Normal file
25
projects/octorest/LICENSE
Normal file
|
@ -0,0 +1,25 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-2017 Miro Hrončok <miro@hroncok.cz>
|
||||
Copyright (c) 2017 Jiří Makarius <meadowfrey@gmail.com>
|
||||
Copyright (c) 2018 Douglas Brion <me@douglasbrion.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Provided license texts might have their own copyrights and restrictions
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
5
projects/octorest/MANIFEST.in
Normal file
5
projects/octorest/MANIFEST.in
Normal file
|
@ -0,0 +1,5 @@
|
|||
include README.md
|
||||
include LICENSE
|
||||
recursive-include tests *.py
|
||||
recursive-include tests *.json
|
||||
recursive-include tests *.gcode
|
244
projects/octorest/README.rst
Normal file
244
projects/octorest/README.rst
Normal file
|
@ -0,0 +1,244 @@
|
|||
===========================
|
||||
OctoRest
|
||||
===========================
|
||||
|
||||
.. image:: https://pepy.tech/badge/octorest
|
||||
:target: https://pepy.tech/project/octorest
|
||||
:alt: Downloads
|
||||
|
||||
.. image:: https://img.shields.io/pypi/l/ansicolortags.svg
|
||||
:target: https://pypi.python.org/pypi/ansicolortags/
|
||||
:alt: PyPI license
|
||||
|
||||
.. image:: https://badge.fury.io/py/erichek.svg
|
||||
:target: https://badge.fury.io/py/erichek
|
||||
:alt: PyPI version
|
||||
|
||||
.. image:: https://img.shields.io/pypi/pyversions/erichek.svg
|
||||
:target: https://img.shields.io/pypi/pyversions/erichek.svg
|
||||
:alt: Python version
|
||||
|
||||
|
||||
Python client library for OctoPrint REST API
|
||||
|
||||
This is continued work after the great start by Miro Hrončok of covering the
|
||||
OctoPrint REST API. Nearly all current functionality in the API has been covered (up to OctoPrint 1.3.11),
|
||||
but as of yet I have not had time to add extensive testing for all aspects of the API.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
The easiest way to install the package is via ``pip``::
|
||||
|
||||
$ pip install octorest
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
You may want a function which returns an instance of the OctoRest object connected to your printer.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def make_client(url, apikey):
|
||||
"""Creates and returns an instance of the OctoRest client.
|
||||
|
||||
Args:
|
||||
url - the url to the OctoPrint server
|
||||
apikey - the apikey from the OctoPrint server found in settings
|
||||
"""
|
||||
try:
|
||||
client = OctoRest(url=url, apikey=apikey)
|
||||
return client
|
||||
except ConnectionError as ex:
|
||||
# Handle exception as you wish
|
||||
print(ex)
|
||||
|
||||
Once we have a client we can do many a cool thing with it!
|
||||
For example the following retrieves all the G-code file names on your OctoPrint server and adds them to a string which is printed out.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def file_names(client):
|
||||
"""Retrieves the G-code file names from the
|
||||
OctoPrint server and returns a string message listing the
|
||||
file names.
|
||||
|
||||
Args:
|
||||
client - the OctoRest client
|
||||
"""
|
||||
message = "The GCODE files currently on the printer are:\n\n"
|
||||
for k in client.files()['files']:
|
||||
message += k['name'] + "\n"
|
||||
print(message)
|
||||
|
||||
Maybe you want to stop your print and then subsequently home the printer. This is very simple to do using OctoRest!
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def toggle_home(client):
|
||||
"""Toggles the current print (if printing it pauses and
|
||||
if paused it starts printing) and then homes all of
|
||||
the printers axes.
|
||||
|
||||
Args:
|
||||
client - the OctoRest client
|
||||
"""
|
||||
print("toggling the print!")
|
||||
client.toggle()
|
||||
print("Homing your 3d printer...")
|
||||
client.home()
|
||||
|
||||
Implemented features of OctoPrint REST API
|
||||
------------------------------------------
|
||||
|
||||
A check list of the features currently implemented can be seen below.
|
||||
|
||||
* General information
|
||||
- [ ] Authorization
|
||||
- [ ] Login
|
||||
- [ ] Logout
|
||||
* Version information
|
||||
- [X] Version information
|
||||
* Apps
|
||||
- [ ] Session Keys (Deprecated since version 1.3.11: This functionality will be removed in 1.4.0. Use the Application Keys Plugin workflow instead.)
|
||||
|
||||
- [ ] Obtaining a temporary session key
|
||||
- [ ] Verifying a temporary session key
|
||||
- [ ] Application Keys Plugin workflow
|
||||
|
||||
- [X] Probe workflow support
|
||||
- [X] Start authorization process
|
||||
- [X] Poll for decision on existing request
|
||||
- [ ] Decide on existing request
|
||||
- [ ] Fetch list of existing application keys
|
||||
- [ ] Issue an application key command
|
||||
* Connection handling
|
||||
- [X] Get connection settings
|
||||
- [X] Issue a connection command
|
||||
|
||||
- [X] Connect
|
||||
- [X] Disconnect
|
||||
- [X] Fake_ack
|
||||
* File operations
|
||||
- [X] Retrieve all files
|
||||
- [X] Retrieve files from specific location
|
||||
- [X] Upload file or create folder
|
||||
- [X] Retrieve a specific file’s or folder’s information
|
||||
- [X] Issue a file command
|
||||
|
||||
- [X] Select
|
||||
- [X] Slice
|
||||
- [X] Copy
|
||||
- [X] Move
|
||||
- [X] Delete file
|
||||
* Job operations
|
||||
- [X] Issue a job command
|
||||
|
||||
- [X] Start
|
||||
- [X] Cancel
|
||||
- [X] Restart
|
||||
- [X] Pause
|
||||
|
||||
- [X] Pause
|
||||
- [X] Resume
|
||||
- [X] Toggle
|
||||
- [X] Retrieve information about the current job
|
||||
* Languages
|
||||
- [X] Retrieve installed language packs
|
||||
- [X] Upload a language pack
|
||||
- [X] Delete a language pack
|
||||
* Log file management
|
||||
- [X] Retrieve a list of available log files
|
||||
- [X] Delete a specific logfile
|
||||
* Printer operations
|
||||
- [X] Retrieve the current printer state
|
||||
- [X] Issue a print head command
|
||||
|
||||
- [X] Jog
|
||||
- [X] Home
|
||||
- [X] Feedrate
|
||||
- [X] Issue a tool command
|
||||
|
||||
- [X] Target
|
||||
- [X] Offset
|
||||
- [X] Select
|
||||
- [X] Extrude
|
||||
- [X] Flowrate
|
||||
- [X] Retrieve the current tool state
|
||||
- [X] Issue a bed command
|
||||
|
||||
- [X] Target
|
||||
- [X] Offset
|
||||
- [X] Retrieve the current bed state
|
||||
- [X] Issue a chamber command
|
||||
|
||||
- [X] Target
|
||||
- [X] Offset
|
||||
- [X] Retrieve the current chamber state
|
||||
- [X] Issue an SD command
|
||||
|
||||
- [X] Init
|
||||
- [X] Refresh
|
||||
- [X] Release
|
||||
- [X] Retrieve the current SD state
|
||||
- [X] Retrieve custom controls from config.yaml
|
||||
- [X] Send an arbitrary command to the printer
|
||||
* Printer profile operations
|
||||
- [X] Retrieve all printer profiles
|
||||
- [X] Retrieve specific printer profile
|
||||
- [ ] Add a new printer profile
|
||||
- [ ] Update an existing printer profile
|
||||
- [X] Remove an existing printer profile
|
||||
* Settings
|
||||
- [X] Retrieve current settings
|
||||
- [X] Save settings
|
||||
- [ ] Regenerate the system wide API key
|
||||
- [ ] Fetch template data (in beta)
|
||||
* Slicing
|
||||
- [X] List All Slicers and Slicing Profiles
|
||||
- [X] List Slicing Profiles of a Specific Slicer
|
||||
- [X] Retrieve Specific Profile
|
||||
- [ ] Add Slicing Profile
|
||||
- [X] Delete Slicing Profile
|
||||
* System
|
||||
- [X] List all registered system commands
|
||||
- [X] List all registered system commands for a source
|
||||
- [X] Execute a registered system command
|
||||
* Timelapse
|
||||
- [X] Retrieve a list of timelapses and the current config
|
||||
- [X] Delete a timelapse
|
||||
- [X] Issue a command for an unrendered timelapse
|
||||
|
||||
- [X] Render
|
||||
- [X] Delete an unrendered timelapse
|
||||
- [X] Change current timelapse config
|
||||
* User
|
||||
- [X] Retrieve a list of users
|
||||
- [X] Retrieve a user
|
||||
- [X] Add a user
|
||||
- [X] Update a user
|
||||
- [X] Delete a user
|
||||
- [X] Reset a user’s password
|
||||
- [X] Retrieve a user’s settings
|
||||
- [ ] Update a user’s settings
|
||||
- [X] Regenerate a user’s personal API key
|
||||
- [X] Delete a user’s personal API key
|
||||
* Util
|
||||
- [X] Test paths or URLs
|
||||
|
||||
- [X] Path
|
||||
- [X] URL
|
||||
- [X] Server
|
||||
* Wizard
|
||||
- [X] Retrieve additional data about registered wizards
|
||||
- [X] Finish wizards
|
||||
|
||||
Copyright & License
|
||||
-------------------
|
||||
|
||||
Copyright (c) 2016-2017 `Miro Hrončok <miro@hroncok.cz/>`_. MIT License.
|
||||
|
||||
Copyright (c) 2017 `Jiří Makarius <meadowfrey@gmail.com/>`_. MIT License.
|
||||
|
||||
Copyright (c) 2018-2019, `Douglas Brion <me@douglasbrion.com/>`_. MIT License.
|
|
@ -0,0 +1,34 @@
|
|||
from octorest import OctoRest, WorkflowAppKeyRequestResult
|
||||
|
||||
def main():
|
||||
url = "http://octopi.local"
|
||||
user = "user"
|
||||
|
||||
client = None
|
||||
|
||||
try:
|
||||
client = OctoRest(url=url)
|
||||
except TypeError:
|
||||
raise NotImplementedError() # Decide what should happen now
|
||||
|
||||
(result, api_key) = (None, None)
|
||||
|
||||
try:
|
||||
(result, api_key) = client.try_get_api_key('my-app', user)
|
||||
except ConnectionError:
|
||||
raise NotImplementedError() # Decide what should happen now. Suggestion - tell the user the OctoPrint server is unreachable and that he should check the URL entered
|
||||
|
||||
if result == WorkflowAppKeyRequestResult.WORKFLOW_UNSUPPORTED:
|
||||
raise NotImplementedError() # Decide what should happen now. Suggestion - fall back to asking the user to manually enter a valid API key.
|
||||
elif result == WorkflowAppKeyRequestResult.TIMED_OUT: # The user took too long to approve the API key request
|
||||
raise NotImplementedError() # Decide what should happen now
|
||||
elif result == WorkflowAppKeyRequestResult.NOPE: # The request has been denied
|
||||
raise NotImplementedError() # Decide what should happen now
|
||||
elif result == WorkflowAppKeyRequestResult.GRANTED:
|
||||
client.load_api_key(api_key) # You have to load the API key before sending any requests to the OctoPrint server
|
||||
pass # At this point you can use the client for whatever you wish
|
||||
|
||||
raise NotImplementedError() # Decide what should happen now
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
37
projects/octorest/examples/basic/basic.py
Normal file
37
projects/octorest/examples/basic/basic.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
from octorest import OctoRest
|
||||
|
||||
|
||||
def make_client():
|
||||
try:
|
||||
client = OctoRest(url="http://octopi.local", apikey="YouShallNotPass")
|
||||
return client
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def get_version():
|
||||
client = make_client()
|
||||
message = "You are using OctoPrint v" + client.version['server'] + "\n"
|
||||
return message
|
||||
|
||||
def get_printer_info():
|
||||
try:
|
||||
client = OctoRest(url="http://octopi.local", apikey="YouShallNotPass")
|
||||
message = ""
|
||||
message += str(client.version) + "\n"
|
||||
message += str(client.job_info()) + "\n"
|
||||
printing = client.printer()['state']['flags']['printing']
|
||||
if printing:
|
||||
message += "Currently printing!\n"
|
||||
else:
|
||||
message += "Not currently printing...\n"
|
||||
return message
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def main():
|
||||
c = make_client()
|
||||
for k in c.files()['files']:
|
||||
print(k['name'])
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
218
projects/octorest/examples/facebook_chatbot/chatbot.py
Normal file
218
projects/octorest/examples/facebook_chatbot/chatbot.py
Normal file
|
@ -0,0 +1,218 @@
|
|||
import random
|
||||
import os
|
||||
from flask import Flask, request
|
||||
from pymessenger2.bot import Bot
|
||||
from octorest import OctoRest
|
||||
|
||||
class ChatBot(Flask):
|
||||
|
||||
def __init__(self, fb_access_tok='YourFBAccessToken',
|
||||
fb_verify_tok="YourTokenVerification",
|
||||
octo_url="http://octopi.local",
|
||||
octo_apikey="YouShallNotPass"):
|
||||
"""
|
||||
Initialisation of the ChatBot for OctoWatch
|
||||
Parameters:
|
||||
fb_access_tok - the Facebook messenger access token given
|
||||
fb_verify_tok - the Facebook messenger verification code set
|
||||
octo_url - the url of the desired OctoPrint server
|
||||
octo_apikey - the apikey found in the OctoPrint settings
|
||||
"""
|
||||
Flask.__init__(self, __name__)
|
||||
|
||||
self.access_token = fb_access_tok
|
||||
self.verify_token = fb_verify_tok
|
||||
self.url = octo_url
|
||||
self.apikey = octo_apikey
|
||||
|
||||
self.bot = Bot(self.access_token)
|
||||
|
||||
self.recipient = None
|
||||
|
||||
self.client = self.make_client(url=self.url, apikey=self.apikey)
|
||||
|
||||
def make_client(self, url=None, apikey=None):
|
||||
"""
|
||||
Creates and returns an instance of the OctoRest client.
|
||||
Parameters:
|
||||
url - the url to the octoprint server
|
||||
apikey - the apikey from the octoprint server found in settings
|
||||
"""
|
||||
if url is None:
|
||||
url = self.url
|
||||
if apikey is None:
|
||||
url = self.apikey
|
||||
try:
|
||||
client = OctoRest(url=url, apikey=apikey)
|
||||
return client
|
||||
except ConnectionError as ex:
|
||||
print(ex)
|
||||
|
||||
def verify_fb_token(self, token_sent):
|
||||
"""
|
||||
Take token sent by Facebook and verify it matches the verify token
|
||||
If they match, allow the request, else return an error
|
||||
Parameters:
|
||||
token_sent - the token received from Facebook
|
||||
"""
|
||||
if token_sent == self.verify_token:
|
||||
return request.args.get("hub.challenge")
|
||||
return "Invalid verification token"
|
||||
|
||||
def get_message(self):
|
||||
"""
|
||||
Returns a random message from a list of strings
|
||||
"""
|
||||
sample_responses = ["Your print is okay", "I have spotted an error", "1 hour to go"]
|
||||
return random.choice(sample_responses)
|
||||
|
||||
def send_message(self, recipient_id, response):
|
||||
"""
|
||||
Uses PyMessenger to send response to user
|
||||
Sends user the text message provided via input response parameter
|
||||
Parameters
|
||||
recipient_id - the id of the person receiving
|
||||
response - the text message to respond with
|
||||
"""
|
||||
self.bot.send_text_message(recipient_id, response)
|
||||
return "success"
|
||||
|
||||
def send_image(self, recipient_id, response):
|
||||
"""
|
||||
Uses PyMessenger to send response to user
|
||||
Sends user an image provided via the image path in the input response parameter
|
||||
Parameters
|
||||
recipient_id - the id of the person receiving
|
||||
response - the image to respond with given as a path
|
||||
"""
|
||||
self.bot.send_image(recipient_id, response)
|
||||
return "success"
|
||||
|
||||
def get_printer_info(self):
|
||||
"""
|
||||
Retrieves information about the printer
|
||||
and returns a chatbot message with its current state
|
||||
"""
|
||||
message = str(self.client.version) + "\n"
|
||||
message += str(self.client.job_info()) + "\n"
|
||||
printing = self.client.printer()['state']['flags']['printing']
|
||||
if printing:
|
||||
message += "Currently printing!\n"
|
||||
else:
|
||||
message += "Not currently printing...\n"
|
||||
return message
|
||||
|
||||
def get_version(self):
|
||||
"""
|
||||
Retrieves the OctoPrint version and returns chatbot message
|
||||
"""
|
||||
message = "You are using OctoPrint v" + str(self.client.version['server']) + "\n"
|
||||
return message
|
||||
|
||||
def get_gcode_file_names(self):
|
||||
"""
|
||||
Retrieves the GCODE file names from the
|
||||
OctoPrint server and returns chatbot message
|
||||
"""
|
||||
message = "The GCODE files currently on the printer are:\n\n"
|
||||
for k in self.client.files()['files']:
|
||||
message += k['name'] + "\n"
|
||||
return message
|
||||
|
||||
def home(self):
|
||||
"""
|
||||
Homes the 3D printer and returns
|
||||
message to inform the user
|
||||
"""
|
||||
message = "Homing your printer... :)"
|
||||
self.client.home()
|
||||
return message
|
||||
|
||||
def toggle(self):
|
||||
"""
|
||||
Toggles the current print from paused/printing
|
||||
states and returns message to inform the user
|
||||
"""
|
||||
message = "Toggling your print!"
|
||||
self.client.pause()
|
||||
return message
|
||||
|
||||
def receive_message(self):
|
||||
"""
|
||||
Method for sending/receiving messages to/from users
|
||||
on Facebook. Checks if tokens are valid. Depending on
|
||||
the text received will select the appropriate reply.
|
||||
Receives JSON from OctoWatch containing information
|
||||
about the print if there has been an error.
|
||||
"""
|
||||
if request.method == 'GET':
|
||||
"""
|
||||
Before allowing people to message your bot, Facebook has
|
||||
implemented a verify token that confirms all requests
|
||||
that your bot receives came from Facebook.
|
||||
"""
|
||||
token_sent = request.args.get("hub.verify_token")
|
||||
return self.verify_fb_token(token_sent)
|
||||
# if the request was not get, it must be POST and we can just
|
||||
# proceed with sending a message back to user
|
||||
else:
|
||||
# get whatever message a user sent the bot
|
||||
output = request.get_json()
|
||||
# if it was from messenger
|
||||
if 'object' in output and 'entry' in output:
|
||||
for event in output['entry']:
|
||||
messaging = event['messaging']
|
||||
for message in messaging:
|
||||
if message.get('message'):
|
||||
# Facebook Messenger ID for user so we know where
|
||||
# to send response back to
|
||||
recipient_id = message['sender']['id']
|
||||
self.recipient = recipient_id
|
||||
text = message['message'].get('text')
|
||||
if text == 'status':
|
||||
self.send_message(recipient_id, self.get_printer_info())
|
||||
elif text == 'version':
|
||||
self.send_message(recipient_id, self.get_version())
|
||||
elif text == 'files':
|
||||
self.send_message(recipient_id, self.get_gcode_file_names())
|
||||
elif text == 'home':
|
||||
self.send_message(recipient_id, self.home())
|
||||
elif text == 'toggle':
|
||||
self.send_message(recipient_id, self.toggle())
|
||||
elif text == 'pause':
|
||||
self.send_message(recipient_id, self.toggle())
|
||||
elif text == 'resume':
|
||||
self.send_message(recipient_id, self.toggle())
|
||||
elif text == 'cancel':
|
||||
self.send_message(recipient_id, self.toggle())
|
||||
elif message['message'].get('text'):
|
||||
response_sent_text = self.get_message()
|
||||
self.send_message(recipient_id, response_sent_text)
|
||||
# if user sends us a GIF, photo,video,
|
||||
# or any other non-text item
|
||||
if message['message'].get('attachments'):
|
||||
response_sent_nontext = self.get_message()
|
||||
self.send_message(recipient_id, response_sent_nontext)
|
||||
return "Message Processed"
|
||||
# if not recognised
|
||||
else:
|
||||
print("Don't recognise...")
|
||||
return "failed"
|
||||
|
||||
def main():
|
||||
"""
|
||||
The main function of the program.
|
||||
Creates a ChatBot instance and runs.
|
||||
Defines a function for receiving messages
|
||||
using HTTP GET and POST.
|
||||
"""
|
||||
app = ChatBot()
|
||||
|
||||
@app.route("/", methods=['GET', 'POST'])
|
||||
def receive_message():
|
||||
return app.receive_message()
|
||||
|
||||
app.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
62
projects/octorest/requirements.txt
Normal file
62
projects/octorest/requirements.txt
Normal file
|
@ -0,0 +1,62 @@
|
|||
appdirs==1.4.3
|
||||
argh==0.26.2
|
||||
attrs==19.3.0
|
||||
awesome-slugify==1.6.5
|
||||
Babel==2.9.1
|
||||
betamax==0.8.1
|
||||
betamax-serializers==0.2.1
|
||||
blinker==1.4
|
||||
cachelib==0.1
|
||||
certifi==2022.12.7
|
||||
chardet==3.0.4
|
||||
Click==7.0
|
||||
emoji==0.5.4
|
||||
feedparser==5.2.1
|
||||
filetype==1.0.5
|
||||
Flask==0.12.4
|
||||
Flask-Assets==0.12
|
||||
Flask-Babel==0.12.2
|
||||
Flask-Login==0.4.1
|
||||
frozendict==1.2
|
||||
future==0.18.2
|
||||
idna==2.8
|
||||
importlib-metadata==1.3.0
|
||||
itsdangerous==1.1.0
|
||||
Jinja2==2.11.3
|
||||
Markdown==3.1.1
|
||||
MarkupSafe==1.1.1
|
||||
more-itertools==8.0.2
|
||||
netaddr==0.7.19
|
||||
netifaces==0.10.9
|
||||
OctoPrint==1.8.3
|
||||
-e git+git@github.com:dougbrion/octorest.git@510b84dbc4ede1c8bbc92239e04a5c7299f1f96c#egg=octorest
|
||||
packaging==19.2
|
||||
pathtools==0.1.2
|
||||
pkginfo==1.5.0.1
|
||||
pluggy==0.13.1
|
||||
psutil==5.6.7
|
||||
py==1.10.0
|
||||
pyasn1==0.4.8
|
||||
pylru==1.2.0
|
||||
pyparsing==2.4.5
|
||||
pyserial==3.4
|
||||
pytest==5.3.2
|
||||
pytz==2019.3
|
||||
PyYAML==5.4
|
||||
regex==2019.12.9
|
||||
requests==2.22.0
|
||||
rsa==4.7
|
||||
sarge==0.1.5.post0
|
||||
semantic-version==2.8.3
|
||||
sentry-sdk==0.13.2
|
||||
six==1.13.0
|
||||
tornado==4.5.3
|
||||
Unidecode==0.4.21
|
||||
urllib3==1.26.5
|
||||
watchdog==0.9.0
|
||||
wcwidth==0.1.7
|
||||
webassets==0.12.1
|
||||
websocket-client==0.56.0
|
||||
Werkzeug==2.2.3
|
||||
wrapt==1.11.2
|
||||
zipp==0.6.0
|
2
projects/octorest/setup.cfg
Normal file
2
projects/octorest/setup.cfg
Normal file
|
@ -0,0 +1,2 @@
|
|||
[aliases]
|
||||
test=pytest
|
8
projects/octorest/src/octorest/__init__.py
Normal file
8
projects/octorest/src/octorest/__init__.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from .client import OctoRest, AuthorizationRequestPollingResult, WorkflowAppKeyRequestResult
|
||||
from .xhrstreaminggenerator import XHRStreamingGenerator
|
||||
from .xhrstreaming import XHRStreamingEventHandler
|
||||
from .websocket import WebSocketEventHandler
|
||||
|
||||
|
||||
__all__ = ['OctoRest', 'AuthorizationRequestPollingResult', 'WorkflowAppKeyRequestResult',
|
||||
'XHRStreamingGenerator','XHRStreamingEventHandler', 'WebSocketEventHandler']
|
1741
projects/octorest/src/octorest/client.py
Normal file
1741
projects/octorest/src/octorest/client.py
Normal file
File diff suppressed because it is too large
Load diff
48
projects/octorest/src/octorest/sockjsclient.py
Normal file
48
projects/octorest/src/octorest/sockjsclient.py
Normal file
|
@ -0,0 +1,48 @@
|
|||
import random
|
||||
import string
|
||||
|
||||
from urllib import parse as urlparse
|
||||
|
||||
|
||||
class SockJSClient:
|
||||
"""
|
||||
Abstract class for SockJS client event handlers
|
||||
"""
|
||||
@classmethod
|
||||
def random_str(cls, length):
|
||||
"""
|
||||
Produces random string of given length
|
||||
It is used for session ID
|
||||
unique for every session of SockJS connection
|
||||
"""
|
||||
letters = string.ascii_lowercase + string.digits
|
||||
return ''.join(random.choice(letters) for c in range(length))
|
||||
|
||||
def __init__(self, url, on_open=None, on_close=None, on_message=None):
|
||||
self.on_open = on_open if callable(on_open) else lambda x: None
|
||||
self.on_close = on_close if callable(on_close) else lambda x: None
|
||||
self.on_message = on_message if callable(on_message) else lambda x, y: None
|
||||
|
||||
self.thread = None
|
||||
self.socket = None
|
||||
|
||||
parsed_url = urlparse.urlparse(url)
|
||||
self.base_url = parsed_url.netloc
|
||||
self.secure = True if parsed_url.scheme in ["wss", "https"] else False
|
||||
|
||||
server_id = str(random.randint(0, 1000))
|
||||
session_id = self.random_str(8)
|
||||
self.url = "{protocol}://" + \
|
||||
"/".join((self.base_url, "sockjs", server_id, session_id)) \
|
||||
+ "/{method}"
|
||||
|
||||
def wait(self):
|
||||
self.thread.join()
|
||||
|
||||
def run(self):
|
||||
"""Initializes and starts thread and socket communication"""
|
||||
raise NotImplementedError("Should have implemented this")
|
||||
|
||||
def send(self, data):
|
||||
"""Send data across socket communication"""
|
||||
raise NotImplementedError("Should have implemented this")
|
55
projects/octorest/src/octorest/websocket.py
Normal file
55
projects/octorest/src/octorest/websocket.py
Normal file
|
@ -0,0 +1,55 @@
|
|||
import json
|
||||
from threading import Thread
|
||||
|
||||
import websocket
|
||||
|
||||
from octorest.sockjsclient import SockJSClient
|
||||
|
||||
|
||||
class WebSocketEventHandler(SockJSClient):
|
||||
"""
|
||||
Class for SockJS WebSocket communication
|
||||
|
||||
params:
|
||||
url - url of Printer
|
||||
on_open - callback function with 1 argument, api of WebSocketApp
|
||||
- executes on creating new connection
|
||||
on_close - callback function with 1 argument, api of WebSocketApp
|
||||
- executes on connection close
|
||||
on_message - callback function with 2 arguments, api of WebSocketApp
|
||||
and message in dict format
|
||||
- executes on received message, if array, then it executes
|
||||
for every value of given array
|
||||
"""
|
||||
def __init__(self, url, on_open=None, on_close=None, on_message=None):
|
||||
super().__init__(url, on_open, on_close, on_message)
|
||||
|
||||
self.url = self.url.format(protocol="wss" if self.secure else "ws",
|
||||
method="websocket")
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Runs thread, which listens on socket.
|
||||
Executes given callbacks on events
|
||||
"""
|
||||
def on_message(ws, data):
|
||||
if data.startswith('m'):
|
||||
self.on_message(ws, json.loads(data[1:]))
|
||||
elif data.startswith('a'):
|
||||
for msg in json.loads(data[1:]):
|
||||
self.on_message(ws, msg)
|
||||
|
||||
self.socket = websocket.WebSocketApp(self.url,
|
||||
on_open=self.on_open,
|
||||
on_close=self.on_close,
|
||||
on_message=on_message)
|
||||
self.thread = Thread(target=self.socket.run_forever)
|
||||
self.thread.daemon = True
|
||||
self.thread.start()
|
||||
|
||||
def send(self, data):
|
||||
"""
|
||||
Sends data, currently not working properly.
|
||||
OctoPrint server is unable to parse.
|
||||
"""
|
||||
self.socket.send(json.dumps(data))
|
73
projects/octorest/src/octorest/xhrstreaming.py
Normal file
73
projects/octorest/src/octorest/xhrstreaming.py
Normal file
|
@ -0,0 +1,73 @@
|
|||
import json
|
||||
from threading import Thread
|
||||
|
||||
import requests
|
||||
|
||||
from octorest.sockjsclient import SockJSClient
|
||||
|
||||
|
||||
class XHRStreamingEventHandler(SockJSClient):
|
||||
"""
|
||||
Class for SockJS communication with XHRStreaming method
|
||||
|
||||
params:
|
||||
url - url of Printer
|
||||
on_open - callback function with 1 argument, api of WebSocketApp
|
||||
- executes on creating new connection
|
||||
on_close - callback function with 1 argument, api of WebSocketApp
|
||||
- executes on connection close
|
||||
on_message - callback function with 2 arguments, api of WebSocketApp
|
||||
and message in dict format
|
||||
- executes on received message, if array, then it executes
|
||||
for every value of given array
|
||||
"""
|
||||
def __init__(self, url,
|
||||
on_open=None, on_close=None, on_message=None, session=None):
|
||||
|
||||
super().__init__(url, on_open, on_close, on_message)
|
||||
|
||||
self.socket = session or requests.Session()
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Runs thread, which listens on socket.
|
||||
Executes given callbacks on events
|
||||
"""
|
||||
self.thread = Thread(target=self._xhr_streaming_run)
|
||||
self.thread.daemon = True
|
||||
self.thread.start()
|
||||
|
||||
def _xhr_streaming_run(self):
|
||||
"""
|
||||
Function for getting data and executing callbacks
|
||||
"""
|
||||
url = self.url.format(protocol="https" if self.secure else "http",
|
||||
method="xhr_streaming")
|
||||
while True:
|
||||
try:
|
||||
connection = self.socket.post(url, stream=True)
|
||||
for line in connection.iter_lines():
|
||||
line = line.decode('utf-8')
|
||||
if line.startswith('o'):
|
||||
self.on_open(self)
|
||||
elif line.startswith('c'):
|
||||
self.on_close(self)
|
||||
elif line.startswith('m'):
|
||||
data = json.loads(line[1:])
|
||||
self.on_message(self, data)
|
||||
elif line.startswith('a'):
|
||||
for msg in json.loads(line[1:]):
|
||||
self.on_message(self, msg)
|
||||
finally:
|
||||
connection.close()
|
||||
|
||||
def send(self, data):
|
||||
"""
|
||||
Sends data, currently not working properly.
|
||||
OctoPrint server returns 404.
|
||||
"""
|
||||
print("SENDING")
|
||||
url = self.url.format(protocol="https" if self.secure else "http",
|
||||
method="xhr_send")
|
||||
response = self.socket.post(url, data=json.dumps(data))
|
||||
return response
|
68
projects/octorest/src/octorest/xhrstreaminggenerator.py
Normal file
68
projects/octorest/src/octorest/xhrstreaminggenerator.py
Normal file
|
@ -0,0 +1,68 @@
|
|||
import json
|
||||
import random
|
||||
import string
|
||||
from urllib import parse as urlparse
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
class XHRStreamingGenerator:
|
||||
"""
|
||||
Class that can communicate to SockJS server with XHR streaming
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def random_str(cls, length):
|
||||
letters = string.ascii_lowercase + string.digits
|
||||
return ''.join(random.choice(letters) for c in range(length))
|
||||
|
||||
def __init__(self, url, session=None):
|
||||
"""
|
||||
Initialize the connection
|
||||
The url shall include the protocol and port (if necessary)
|
||||
"""
|
||||
self.session = session or requests.Session()
|
||||
r1 = str(random.randint(0, 1000))
|
||||
conn_id = self.random_str(8)
|
||||
self.base_url = url
|
||||
self.url = '/'.join((urlparse.urljoin(url, 'sockjs'), r1, conn_id))
|
||||
|
||||
def info(self):
|
||||
url = urlparse.urljoin(self.base_url, 'sockjs/info')
|
||||
response = self.session.get(url)
|
||||
return response.json()
|
||||
|
||||
def read_loop(self):
|
||||
"""
|
||||
Creates generator object
|
||||
"""
|
||||
url = '/'.join((self.url, 'xhr_streaming'))
|
||||
while True:
|
||||
try:
|
||||
connection = self.session.post(url, stream=True)
|
||||
for line in connection.iter_lines():
|
||||
line = line.decode('utf-8')
|
||||
if line.startswith('o'):
|
||||
continue # open connection
|
||||
if line.startswith('c'):
|
||||
continue # close connection
|
||||
if line.startswith('h'):
|
||||
continue # heartbeat
|
||||
if line.startswith('m'):
|
||||
yield json.loads(line[1:])
|
||||
continue # message
|
||||
if line.startswith('a'):
|
||||
for msg in json.loads(line[1:]):
|
||||
yield msg
|
||||
continue # array
|
||||
finally:
|
||||
connection.close()
|
||||
|
||||
def send(self, data):
|
||||
"""
|
||||
Sends data, currently not working properly.
|
||||
OctoPrint server returns 404
|
||||
"""
|
||||
url = '/'.join((self.url, 'xhr_send'))
|
||||
response = self.session.post(url, data=json.dumps(data))
|
||||
return response
|
7
projects/octorest/test/_common.py
Normal file
7
projects/octorest/test/_common.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import os
|
||||
|
||||
URL = os.environ.get('OCTOPRINT_URL')
|
||||
APIKEY = os.environ.get('OCTOPRINT_APIKEY')
|
||||
|
||||
URL = "http://localhost:5000"
|
||||
APIKEY = "65FD7606F0FB4DF981C639FEDF08F7E6"
|
286
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_change_settings.json
vendored
Normal file
286
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_change_settings.json
vendored
Normal file
File diff suppressed because one or more lines are too long
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_connect.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_connect.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:55",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUw.3rrSWDs1yENR2SP_eCKEwuqH2ME; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:55",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"connect\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"22"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUw.3rrSWDs1yENR2SP_eCKEwuqH2ME"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUw.3rrSWDs1yENR2SP_eCKEwuqH2ME; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:56",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUw.3rrSWDs1yENR2SP_eCKEwuqH2ME"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Connecting\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"546"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetVA.bm6hI_J1ZS5vcNgeovT-gyl0XZA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_connection_info.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_connection_info.json
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Operational\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"547"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
182
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_delete_log.json
vendored
Normal file
182
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_delete_log.json
vendored
Normal file
File diff suppressed because one or more lines are too long
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_disconnect.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_disconnect.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"disconnect\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"25"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:55",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUg.I8LCvGIeN6LtifggZbPYX7IVeDM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": null, \n \"port\": null, \n \"printerProfile\": \"_default\", \n \"state\": \"Closed\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"530"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetUw.3rrSWDs1yENR2SP_eCKEwuqH2ME; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_extruding.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_extruding.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:56:19",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con20w.kVFVvi_PLAxTfODOyP7V_kt15Zo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:56:19",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"amount\": 1, \"command\": \"extrude\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"35"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con20w.kVFVvi_PLAxTfODOyP7V_kt15Zo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con20w.kVFVvi_PLAxTfODOyP7V_kt15Zo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_fake_ack.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_fake_ack.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:09:31",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnevGw.SxPQ-l5MDsmEPEKtYrF7by5jVzo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:09:31",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"fake_ack\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"23"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnevGw.SxPQ-l5MDsmEPEKtYrF7by5jVzo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnevGw.SxPQ-l5MDsmEPEKtYrF7by5jVzo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_feedrate.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_feedrate.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:44:32",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConmAA.10TXH7hc5Ca0oQbWSaJ-jJPIiBs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:44:32",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"feedrate\", \"factor\": 1.0}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"38"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConmAA.10TXH7hc5Ca0oQbWSaJ-jJPIiBs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/printhead"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConmAA.10TXH7hc5Ca0oQbWSaJ-jJPIiBs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/printhead"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
File diff suppressed because one or more lines are too long
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_files_local_works.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_files_local_works.json
vendored
Normal file
File diff suppressed because one or more lines are too long
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_files_sdcard_works.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_files_sdcard_works.json
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/files/sdcard"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"files\": []\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"17"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/sdcard"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_flowrate.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_flowrate.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:59:43",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con3nw.Nw7AqkN0M9aZ9PYlmtjT8f5OpyU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:59:44",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"flowrate\", \"factor\": 1.0}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"38"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con3nw.Nw7AqkN0M9aZ9PYlmtjT8f5OpyU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con3oA.WNfQEILPwegguj5qNiMfVkdRVXA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
138
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_get_settings.json
vendored
Normal file
138
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_get_settings.json
vendored
Normal file
File diff suppressed because one or more lines are too long
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_home_all.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_home_all.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:37:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConkXw.YhHVMnjXaiyBD8AOIpcpYYxqqJA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:37:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"home\", \"axes\": [\"x\", \"y\", \"z\"]}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"44"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConkXw.YhHVMnjXaiyBD8AOIpcpYYxqqJA"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/printhead"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConkXw.YhHVMnjXaiyBD8AOIpcpYYxqqJA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/printhead"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_home_some.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_home_some.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:38:52",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConkrA.fevE2K2xK4w9Aikweq7pk8S6row; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:38:52",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"home\", \"axes\": [\"x\", \"y\"]}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"39"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConkrA.fevE2K2xK4w9Aikweq7pk8S6row"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/printhead"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConkrA.fevE2K2xK4w9Aikweq7pk8S6row; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/printhead"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_info_for_specific_file.json
vendored
Normal file
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_info_for_specific_file.json
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/files/local/hodorstop.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"date\": 1464620255, \n \"gcodeAnalysis\": {\n \"estimatedPrintTime\": 11398.550506420732, \n \"filament\": {\n \"tool0\": {\n \"length\": 8788.88375, \n \"volume\": 58.05232223829053\n }\n }\n }, \n \"hash\": \"fe6208411628992f488050bbd7f516c3a480e947\", \n \"links\": [], \n \"name\": \"hodorstop.gcode\", \n \"origin\": \"local\", \n \"prints\": {\n \"failure\": 1, \n \"last\": {\n \"date\": 1469099651.292224, \n \"printTime\": 14587.552161931992, \n \"success\": true\n }, \n \"success\": 12\n }, \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/hodorstop.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/hodorstop.gcode\"\n }, \n \"size\": 5894046, \n \"statistics\": {\n \"averagePrintTime\": {\n \"_default\": 14459.99043494463\n }, \n \"lastPrintTime\": {\n \"_default\": 14587.552161931992\n }\n }, \n \"type\": \"machinecode\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"890"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/hodorstop.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/files/local/plate2.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"date\": 1463733114, \n \"gcodeAnalysis\": {\n \"estimatedPrintTime\": 3625.7017746005045, \n \"filament\": {\n \"tool0\": {\n \"length\": 1366.44818, \n \"volume\": 8.717114849239637\n }\n }\n }, \n \"hash\": \"4515363e527de253dc45101b77639cb3097d30c1\", \n \"links\": [], \n \"name\": \"plate2.gcode\", \n \"origin\": \"local\", \n \"prints\": {\n \"failure\": 0, \n \"last\": {\n \"date\": 1463738111.306265, \n \"printTime\": 4454.600942850113, \n \"success\": true\n }, \n \"success\": 1\n }, \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/plate2.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/plate2.gcode\"\n }, \n \"size\": 1919950, \n \"statistics\": {\n \"averagePrintTime\": {\n \"_default\": 4454.600942850113\n }, \n \"lastPrintTime\": {\n \"_default\": 4454.600942850113\n }\n }, \n \"type\": \"machinecode\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"878"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/plate2.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:38",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"nope"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "Invalid API key"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"15"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=eyJfaWQiOnsiIGIiOiJaVGMxTkRZNU1XWm1ORE5sTlRFeU1ERmpaVFJsTmpoa1pXTTJNMlUyWVRBPSJ9fQ.CnetBg.vtMrh7AJognkQw0TsmD2_6kM47k; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 401,
|
||||
"message": "UNAUTHORIZED"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:37",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBQ.2PM6OXJ6FpxqjXufEBpgrdM1yrw; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_jog.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_jog.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:28:31",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConiPw.DBXfBDlrTQ1UoYomYtFzAsgTTa0; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T09:28:31",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"jog\", \"y\": 20}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"27"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConiPw.DBXfBDlrTQ1UoYomYtFzAsgTTa0"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/printhead"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConiPw.DBXfBDlrTQ1UoYomYtFzAsgTTa0; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/printhead"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_logs.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_logs.json
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"commands\": [\"G28 X\", \"G28 Y\"]}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"32"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/command"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/command"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"commands\": [\"G28 X\", \"G28 Y\"]}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"32"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/command"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/command"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_nonexisting_file_raises.json
vendored
Normal file
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_nonexisting_file_raises.json
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetBw.2YzLddeZqqAUtFKpiwKOyqz4tYo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/files/local/nietzsche.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "File not found on 'local': nietzsche.gcode"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"42"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCA.TBe1_1K2YAix1yWu3G3v-EvfxLE; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 404,
|
||||
"message": "NOT FOUND"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/nietzsche.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCA.TBe1_1K2YAix1yWu3G3v-EvfxLE; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCA.TBe1_1K2YAix1yWu3G3v-EvfxLE"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/files/local/noexist.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "File not found on 'local': noexist.gcode"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCA.TBe1_1K2YAix1yWu3G3v-EvfxLE; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 404,
|
||||
"message": "NOT FOUND"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/noexist.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_printer.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_printer.json
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:09:08",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfLJA.BMOeOXRLXc0hatn_eHaSDI4bJOc; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:09:08",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfLJA.BMOeOXRLXc0hatn_eHaSDI4bJOc"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 25.3, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"tool0\": {\n \"actual\": 25.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"474"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfLJA.BMOeOXRLXc0hatn_eHaSDI4bJOc; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,533 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:03",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 24.7, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"tool0\": {\n \"actual\": 24.3, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"474"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:03",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 24.7, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"tool0\": {\n \"actual\": 24.3, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"439"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=sd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:03",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=temperature"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"281"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=temperature"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:04",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfRNw.nquMHU44BOYxd0KNZoM6xOMBn28"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=state"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 24.7, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"tool0\": {\n \"actual\": 24.3, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"229"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=state"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:04",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=sd%2Ctemperature"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"246"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=sd%2Ctemperature"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:04",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=sd%2Cstate"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"temperature\": {\n \"bed\": {\n \"actual\": 24.7, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"tool0\": {\n \"actual\": 24.3, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"194"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=sd%2Cstate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:04",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=temperature%2Cstate"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"36"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=temperature%2Cstate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:04",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:35:04",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?exclude=sd%2Ctemperature%2Cstate"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"2"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfROA.LNniXnp3fbREO1jCMpoNH5iYMaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?exclude=sd%2Ctemperature%2Cstate"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_printer_with_history.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_printer_with_history.json
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,238 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:46:26",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4g.NIXD5ZRzBrRopzrK-CV9irIXr0Q"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?history=true&limit=1"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 24.4, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"history\": [\n {\n \"bed\": {\n \"actual\": 24.4, \n \"target\": 0.0\n }, \n \"time\": 1469465182, \n \"tool0\": {\n \"actual\": 24.1, \n \"target\": 0.0\n }\n }\n ], \n \"tool0\": {\n \"actual\": 24.1, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"704"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4g.NIXD5ZRzBrRopzrK-CV9irIXr0Q; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?history=true&limit=1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4g.NIXD5ZRzBrRopzrK-CV9irIXr0Q"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?history=true&limit=2"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 24.4, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"history\": [\n {\n \"bed\": {\n \"actual\": 24.4, \n \"target\": 0.0\n }, \n \"time\": 1469465177, \n \"tool0\": {\n \"actual\": 24.1, \n \"target\": 0.0\n }\n }, \n {\n \"bed\": {\n \"actual\": 24.4, \n \"target\": 0.0\n }, \n \"time\": 1469465182, \n \"tool0\": {\n \"actual\": 24.1, \n \"target\": 0.0\n }\n }\n ], \n \"tool0\": {\n \"actual\": 24.1, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"911"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4w.aItujrhHT1DNRGTNBVvCqMzZ9DM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?history=true&limit=2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4w.aItujrhHT1DNRGTNBVvCqMzZ9DM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T16:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4w.aItujrhHT1DNRGTNBVvCqMzZ9DM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer?history=true&limit=3"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"sd\": {\n \"ready\": false\n }, \n \"state\": {\n \"flags\": {\n \"closedOrError\": false, \n \"error\": false, \n \"operational\": true, \n \"paused\": false, \n \"printing\": false, \n \"ready\": true, \n \"sdReady\": false\n }, \n \"text\": \"Operational\"\n }, \n \"temperature\": {\n \"bed\": {\n \"actual\": 24.4, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"history\": [\n {\n \"bed\": {\n \"actual\": 24.4, \n \"target\": 0.0\n }, \n \"time\": 1469465172, \n \"tool0\": {\n \"actual\": 24.1, \n \"target\": 0.0\n }\n }, \n {\n \"bed\": {\n \"actual\": 24.4, \n \"target\": 0.0\n }, \n \"time\": 1469465177, \n \"tool0\": {\n \"actual\": 24.1, \n \"target\": 0.0\n }\n }, \n {\n \"bed\": {\n \"actual\": 24.4, \n \"target\": 0.0\n }, \n \"time\": 1469465182, \n \"tool0\": {\n \"actual\": 24.1, \n \"target\": 0.0\n }\n }\n ], \n \"tool0\": {\n \"actual\": 24.1, \n \"offset\": 0, \n \"target\": 0.0\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"1118"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfT4w.aItujrhHT1DNRGTNBVvCqMzZ9DM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer?history=true&limit=3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_retracting.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_retracting.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:56:28",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con23A.xYkd8b93Nt1_xv6zYA9tKTF2qTI; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:56:28",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"extrude\", \"amount\": -1}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"36"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con23A.xYkd8b93Nt1_xv6zYA9tKTF2qTI"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con23A.xYkd8b93Nt1_xv6zYA9tKTF2qTI; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_init.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_init.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:22",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con8sg.Cv-7NygyGvfwgiaAcv5GoxJPlb4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"ready\": false\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con8sg.Cv-7NygyGvfwgiaAcv5GoxJPlb4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"init\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"19"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_refresh.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_refresh.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:22",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con8sg.Cv-7NygyGvfwgiaAcv5GoxJPlb4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"ready\": false\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con8sg.Cv-7NygyGvfwgiaAcv5GoxJPlb4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"refresh\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"22"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_release.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_release.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:22",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con8sg.Cv-7NygyGvfwgiaAcv5GoxJPlb4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"ready\": false\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con8sg.Cv-7NygyGvfwgiaAcv5GoxJPlb4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:21:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"release\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"22"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con80Q.p1B9W2aIPVSLc2vHn7W3wF9Eybk; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_status.json
vendored
Normal file
120
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_sd_card_status.json
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:23:37",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con9OQ.x34Doiwjk4uUasIOAyxw1sdGmsA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:23:37",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con9OQ.x34Doiwjk4uUasIOAyxw1sdGmsA"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/sd"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"ready\": false\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con9OQ.x34Doiwjk4uUasIOAyxw1sdGmsA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/sd"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_selecting_tool.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_selecting_tool.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:50:16",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con1aA.hDZaCZIcQIDiQ0pbq7TWp84ejcs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:50:16",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"tool\": \"tool0\", \"command\": \"select\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"38"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con1aA.hDZaCZIcQIDiQ0pbq7TWp84ejcs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con1aA.hDZaCZIcQIDiQ0pbq7TWp84ejcs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_set_bed_offset_to_10.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_set_bed_offset_to_10.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:05:23",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con48w.zi6OT1Ff9aihHCuu3LE73bQLRkc; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:05:23",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con48w.zi6OT1Ff9aihHCuu3LE73bQLRkc"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/bed"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"bed\": {\n \"actual\": 31.3, \n \"offset\": 10, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"76"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con48w.zi6OT1Ff9aihHCuu3LE73bQLRkc; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:05:24",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"offset\", \"offset\": 0}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"34"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con48w.zi6OT1Ff9aihHCuu3LE73bQLRkc"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/bed"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con49A.G5BaiThIk4LdhuJ1Tb3EEuVJvAg; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:04:38",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con4xg.XxeonICrstGxF8xHv5h72djgbio; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:04:38",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con4xg.XxeonICrstGxF8xHv5h72djgbio"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/bed"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"bed\": {\n \"actual\": 31.1, \n \"offset\": 0, \n \"target\": 100.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"77"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con4xg.XxeonICrstGxF8xHv5h72djgbio; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:04:38",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"target\", \"target\": 0}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"34"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con4xg.XxeonICrstGxF8xHv5h72djgbio"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/bed"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Con4xg.XxeonICrstGxF8xHv5h72djgbio; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_set_tool_offset_to_20.json
vendored
Normal file
188
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_set_tool_offset_to_20.json
vendored
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:31:47",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConxEw.cJ4eBDRMhvENoJ4khuCO6y_Hw58"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"tool0\": {\n \"actual\": 25.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"77"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConxEw.cJ4eBDRMhvENoJ4khuCO6y_Hw58; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:33:03",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConxXw.9npwYu1rF68vpoS4NO8J_Kzh6xs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:33:03",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"offsets\": {\"tool0\": 0}, \"command\": \"offset\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"46"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConxXw.9npwYu1rF68vpoS4NO8J_Kzh6xs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConxXw.9npwYu1rF68vpoS4NO8J_Kzh6xs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:21:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Conusw.m5AJ1hkWfdcEKEdsotaUNH69vaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:21:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Conusw.m5AJ1hkWfdcEKEdsotaUNH69vaM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"tool0\": {\n \"actual\": 28.5, \n \"offset\": 0, \n \"target\": 200.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"79"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Conusw.m5AJ1hkWfdcEKEdsotaUNH69vaM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T10:21:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"targets\": {\"tool0\": 0}, \"command\": \"target\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"46"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Conusw.m5AJ1hkWfdcEKEdsotaUNH69vaM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.ConutA._K3fZQGvzKtT4fhGgdm-rjdLTgM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_single_gcode_command.json
vendored
Normal file
129
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_single_gcode_command.json
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-08-08T11:46:27",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"commands\": [\"G28 X\"]}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"23"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/printer/command"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CooCkw.Z-XzqWJmsH_a5fGr53SqMs4KqRU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/command"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_tool_and_bed.json
vendored
Normal file
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_tool_and_bed.json
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:50",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbeg.O38ls6wzmSDAiyKvKSi-cFSQP0M"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/tool"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"tool0\": {\n \"actual\": 24.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"77"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbeg.O38ls6wzmSDAiyKvKSi-cFSQP0M; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:51",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbew.ZB93J2NOl1PeMqknnsoETAe89-c; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:51",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbew.ZB93J2NOl1PeMqknnsoETAe89-c"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/bed"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"bed\": {\n \"actual\": 24.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"75"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbew.ZB93J2NOl1PeMqknnsoETAe89-c; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_tool_and_bed_with_history.json
vendored
Normal file
179
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_tool_and_bed_with_history.json
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,415 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/tool?limit=1&history=true"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"history\": [\n {\n \"time\": 1469467131, \n \"tool0\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }\n }\n ], \n \"tool0\": {\n \"actual\": 24.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"209"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool?limit=1&history=true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/tool?limit=2&history=true"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"history\": [\n {\n \"time\": 1469467126, \n \"tool0\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }\n }, \n {\n \"time\": 1469467131, \n \"tool0\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }\n }\n ], \n \"tool0\": {\n \"actual\": 24.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"322"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool?limit=2&history=true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/tool?limit=3&history=true"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"history\": [\n {\n \"time\": 1469467121, \n \"tool0\": {\n \"actual\": 23.8, \n \"target\": 0.0\n }\n }, \n {\n \"time\": 1469467126, \n \"tool0\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }\n }, \n {\n \"time\": 1469467131, \n \"tool0\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }\n }\n ], \n \"tool0\": {\n \"actual\": 24.0, \n \"offset\": 0, \n \"target\": 0.0\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"435"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/tool?limit=3&history=true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/bed?limit=1&history=true"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"bed\": {\n \"actual\": 24.2, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"history\": [\n {\n \"bed\": {\n \"actual\": 24.2, \n \"target\": 0.0\n }, \n \"time\": 1469467131\n }\n ]\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"205"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed?limit=1&history=true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:53",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/bed?limit=2&history=true"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"bed\": {\n \"actual\": 24.2, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"history\": [\n {\n \"bed\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }, \n \"time\": 1469467126\n }, \n {\n \"bed\": {\n \"actual\": 24.2, \n \"target\": 0.0\n }, \n \"time\": 1469467131\n }\n ]\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"316"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnfbfQ.c-Uqht9-R1Sen1afqQIJzcWCFto; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed?limit=2&history=true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbfg.xpul46Q5TTYYmiHUHpv78jJdJcw; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T17:18:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbfg.xpul46Q5TTYYmiHUHpv78jJdJcw"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/printer/bed?limit=3&history=true"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"bed\": {\n \"actual\": 24.2, \n \"offset\": 0, \n \"target\": 0.0\n }, \n \"history\": [\n {\n \"bed\": {\n \"actual\": 24.3, \n \"target\": 0.0\n }, \n \"time\": 1469467121\n }, \n {\n \"bed\": {\n \"actual\": 24.0, \n \"target\": 0.0\n }, \n \"time\": 1469467126\n }, \n {\n \"bed\": {\n \"actual\": 24.2, \n \"target\": 0.0\n }, \n \"time\": 1469467131\n }\n ]\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"427"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cnfbfg.xpul46Q5TTYYmiHUHpv78jJdJcw; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/printer/bed?limit=3&history=true"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
206
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_unchanged_settings.json
vendored
Normal file
206
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_unchanged_settings.json
vendored
Normal file
File diff suppressed because one or more lines are too long
312
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_and_print.json
vendored
Normal file
312
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_and_print.json
vendored
Normal file
|
@ -0,0 +1,312 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:22",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne13g.xakIKg5AIeaBcw072fzIYw_Q8_w; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:25",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--1d01e8af2f2a4c36a5c9daf0e9b9f4da\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\ntrue\r\n--1d01e8af2f2a4c36a5c9daf0e9b9f4da\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--1d01e8af2f2a4c36a5c9daf0e9b9f4da\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--1d01e8af2f2a4c36a5c9daf0e9b9f4da--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"375"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=1d01e8af2f2a4c36a5c9daf0e9b9f4da"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne13g.xakIKg5AIeaBcw072fzIYw_Q8_w"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne14Q._w3JupF1JxZoROCmlajduj-Pa0U; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:26",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne14Q._w3JupF1JxZoROCmlajduj-Pa0U"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"job\": {\n \"averagePrintTime\": null, \n \"estimatedPrintTime\": null, \n \"filament\": {\n \"tool0\": {\n \"length\": 0.0, \n \"volume\": 0.0\n }\n }, \n \"file\": {\n \"date\": 1469457505, \n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"size\": 6\n }, \n \"lastPrintTime\": null\n }, \n \"progress\": {\n \"completion\": 0, \n \"filepos\": null, \n \"printTime\": null, \n \"printTimeLeft\": null\n }, \n \"state\": \"Printing\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"466"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne14g.55GD-XopDq4yE2XeosJAmOVE6MU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:26",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne14g.55GD-XopDq4yE2XeosJAmOVE6MU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Printing\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"544"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne14g.55GD-XopDq4yE2XeosJAmOVE6MU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne14g.55GD-XopDq4yE2XeosJAmOVE6MU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne16w.3CAf4ALHyg2LCsS0fzxgDOr5A9s; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
253
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_and_select.json
vendored
Normal file
253
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_and_select.json
vendored
Normal file
|
@ -0,0 +1,253 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:11",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne10w.6JN82vY9s4DEwBhv1ZDiSsIj1-E; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:15",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--42a345b6f18843e586dd3cd1102c0705\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--42a345b6f18843e586dd3cd1102c0705\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\ntrue\r\n--42a345b6f18843e586dd3cd1102c0705\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--42a345b6f18843e586dd3cd1102c0705--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"375"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=42a345b6f18843e586dd3cd1102c0705"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne10w.6JN82vY9s4DEwBhv1ZDiSsIj1-E"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne11w.eGdWQySHByYfGx_6kPlR8uzlfec; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:16",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne11w.eGdWQySHByYfGx_6kPlR8uzlfec"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"job\": {\n \"averagePrintTime\": null, \n \"estimatedPrintTime\": null, \n \"filament\": {\n \"tool0\": {\n \"length\": 0.0, \n \"volume\": 0.0\n }\n }, \n \"file\": {\n \"date\": 1469457494, \n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"size\": 6\n }, \n \"lastPrintTime\": null\n }, \n \"progress\": {\n \"completion\": 0, \n \"filepos\": null, \n \"printTime\": null, \n \"printTimeLeft\": null\n }, \n \"state\": \"Operational\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"469"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne12A.Ub88CqtTjI9HOqjHGmqyYmGrQ-8; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:21",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne12A.Ub88CqtTjI9HOqjHGmqyYmGrQ-8"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne13Q.OIBIN2LRguzmaK1rggKwA80_YlQ; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,448 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:33",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yQ.CO6cYGdtRY0vmEi5ftp3z6hFWP4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:34",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--588ffed34f60406bbcfe14d12fadbdd5\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--588ffed34f60406bbcfe14d12fadbdd5\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--588ffed34f60406bbcfe14d12fadbdd5\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--588ffed34f60406bbcfe14d12fadbdd5--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"376"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=588ffed34f60406bbcfe14d12fadbdd5"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yQ.CO6cYGdtRY0vmEi5ftp3z6hFWP4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yg.BMjc_Rko3d9umK8SSU64a9NJYKA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"select\", \"print\": false}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"37"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yg.BMjc_Rko3d9umK8SSU64a9NJYKA"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"job\": {\n \"averagePrintTime\": 0.7757258415222168, \n \"estimatedPrintTime\": null, \n \"filament\": {\n \"tool0\": {\n \"length\": 0.0, \n \"volume\": 0.0\n }\n }, \n \"file\": {\n \"date\": 1469457993, \n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"size\": 6\n }, \n \"lastPrintTime\": 0.7757258415222168\n }, \n \"progress\": {\n \"completion\": 0, \n \"filepos\": null, \n \"printTime\": null, \n \"printTimeLeft\": null\n }, \n \"state\": \"Operational\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"497"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"start\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Printing\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"544"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:46:44",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne3yw.DU6GRTdZPPmqQefsaCg-bpE0sQs"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne31A.JV1tQVnVHSLrRbFVNwAcdin_2aU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,321 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:36",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne17A.drCeDSGJ8gzAovF5s2YO8xRxruU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:39",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--e39b7661282146ddb94d0db21d733ddf\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--e39b7661282146ddb94d0db21d733ddf\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--e39b7661282146ddb94d0db21d733ddf\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--e39b7661282146ddb94d0db21d733ddf--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"376"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=e39b7661282146ddb94d0db21d733ddf"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne17A.drCeDSGJ8gzAovF5s2YO8xRxruU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne17w.cQjh_gr0fbkx--r0omS2WhUkf98; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"print\": false, \"command\": \"select\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"37"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne17w.cQjh_gr0fbkx--r0omS2WhUkf98"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne18A.S4JnJjGmucmplodYUTlp82MEifQ; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne18A.S4JnJjGmucmplodYUTlp82MEifQ"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"job\": {\n \"averagePrintTime\": null, \n \"estimatedPrintTime\": null, \n \"filament\": {\n \"tool0\": {\n \"length\": 0.0, \n \"volume\": 0.0\n }\n }, \n \"file\": {\n \"date\": 1469457519, \n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"size\": 6\n }, \n \"lastPrintTime\": null\n }, \n \"progress\": {\n \"completion\": 0, \n \"filepos\": null, \n \"printTime\": null, \n \"printTimeLeft\": null\n }, \n \"state\": \"Operational\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"469"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne18A.S4JnJjGmucmplodYUTlp82MEifQ; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:46",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne18A.S4JnJjGmucmplodYUTlp82MEifQ"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne19g.ESpKDRc4ZJdJp1-VM7kfamNznOs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,380 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:47",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne19w.ROeRU7kblKoSaOq5zJO_r9BtvV8; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:50",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--83e62c28107c47bcacc2c88c90a69a26\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--83e62c28107c47bcacc2c88c90a69a26\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--83e62c28107c47bcacc2c88c90a69a26\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--83e62c28107c47bcacc2c88c90a69a26--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"376"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=83e62c28107c47bcacc2c88c90a69a26"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne19w.ROeRU7kblKoSaOq5zJO_r9BtvV8"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1-g.jLuia-QDhJLhA_Pk0ACosh2P9MA; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:51",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"print\": true, \"command\": \"select\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"36"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1-g.jLuia-QDhJLhA_Pk0ACosh2P9MA"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1-w.P0zJaLc6GQj8TnmN3_s0LozfZk4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:51",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1-w.P0zJaLc6GQj8TnmN3_s0LozfZk4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"job\": {\n \"averagePrintTime\": null, \n \"estimatedPrintTime\": null, \n \"filament\": {\n \"tool0\": {\n \"length\": 0.0, \n \"volume\": 0.0\n }\n }, \n \"file\": {\n \"date\": 1469457530, \n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"size\": 6\n }, \n \"lastPrintTime\": null\n }, \n \"progress\": {\n \"completion\": 0, \n \"filepos\": null, \n \"printTime\": null, \n \"printTimeLeft\": null\n }, \n \"state\": \"Printing\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"466"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1-w.P0zJaLc6GQj8TnmN3_s0LozfZk4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:38:52",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1-w.P0zJaLc6GQj8TnmN3_s0LozfZk4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Printing\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"544"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1_A.W0jEGRMySfrGA1G6zp0cE2UDtkw; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:39:01",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne1_A.W0jEGRMySfrGA1G6zp0cE2UDtkw"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne2BQ.lG4vqMFx9ATMW9FAosVM9ZqhBRM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
194
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_by_path.json
vendored
Normal file
194
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_by_path.json
vendored
Normal file
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:40",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCA.TBe1_1K2YAix1yWu3G3v-EvfxLE; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:43",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--d407144672fe44a3a736a6f97ee68057\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--d407144672fe44a3a736a6f97ee68057\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--d407144672fe44a3a736a6f97ee68057\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--d407144672fe44a3a736a6f97ee68057--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"376"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=d407144672fe44a3a736a6f97ee68057"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCA.TBe1_1K2YAix1yWu3G3v-EvfxLE"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCw.czU7it6CQmlonOqy21on_MdG2Yo; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:50",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetCw.czU7it6CQmlonOqy21on_MdG2Yo"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetEg.UtgsVSQVmRFLAjTjpYIMCn5BCzY; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
194
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_file_object.json
vendored
Normal file
194
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_file_object.json
vendored
Normal file
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:51",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetEw.DFksf3gKco8qcvCz6zqeX5JPIcM; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:00:54",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--4e7eb470a1674403a282e31068dd81ab\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--4e7eb470a1674403a282e31068dd81ab\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--4e7eb470a1674403a282e31068dd81ab\r\nContent-Disposition: form-data; name=\"file\"; filename=\"fake.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--4e7eb470a1674403a282e31068dd81ab--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"375"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=4e7eb470a1674403a282e31068dd81ab"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetEw.DFksf3gKco8qcvCz6zqeX5JPIcM"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"fake.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/fake.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/fake.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"289"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/fake.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetFg.0pTfIgOyoMM0xAeSbNTwm0vUc9A; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:01:00",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetFg.0pTfIgOyoMM0xAeSbNTwm0vUc9A"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/fake.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.CnetHA.FtcpSe5epaicl3Pbb41grNTETPU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/fake.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
457
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_print_pause_cancel.json
vendored
Normal file
457
projects/octorest/test/fixtures/cassettes/test_client.TestClient.test_upload_print_pause_cancel.json
vendored
Normal file
|
@ -0,0 +1,457 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:32",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne55A.bLTUpNhN3iLMj73o9RWs2PcolMU; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:35",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--457cf9c4e122464da4ef7b8377f3c15c\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--457cf9c4e122464da4ef7b8377f3c15c\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--457cf9c4e122464da4ef7b8377f3c15c\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--457cf9c4e122464da4ef7b8377f3c15c--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"376"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=457cf9c4e122464da4ef7b8377f3c15c"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne55A.bLTUpNhN3iLMj73o9RWs2PcolMU"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne55w.0iMoi7tFPIavUeLizK8XEhFKjaI; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:36",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"print\": true, \"command\": \"select\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"36"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne55w.0iMoi7tFPIavUeLizK8XEhFKjaI"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne56A.ANvaKY58Uhd9_r0jclerFwiBamE; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:37",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"pause\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne56A.ANvaKY58Uhd9_r0jclerFwiBamE"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne56Q.vzJzBjTjlL83C1uknbRvacrIfB0; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:38",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne56Q.vzJzBjTjlL83C1uknbRvacrIfB0"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Paused\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"542"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne56g.Blu8vZC7WPUVEWZma82OaXcx5y0; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:45",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"cancel\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"21"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne56g.Blu8vZC7WPUVEWZma82OaXcx5y0"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne58Q.s0clNUVqv3Nxpjug-3SXO_horj8; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:55:49",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne58Q.s0clNUVqv3Nxpjug-3SXO_horj8"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne59Q.K9rWo6Q6TRcVyPuPMrrHZLbjxMs; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,457 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:42",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/version"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"api\": \"0.1\", \n \"server\": \"1.2.2\"\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"40"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne63g.byk8IKEzbAYmD6rrywDI3Uu0quY; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/version"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:45",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "--a19568a4e7304093bb9b7d0246f9ba1e\r\nContent-Disposition: form-data; name=\"select\"\r\n\r\nfalse\r\n--a19568a4e7304093bb9b7d0246f9ba1e\r\nContent-Disposition: form-data; name=\"print\"\r\n\r\nfalse\r\n--a19568a4e7304093bb9b7d0246f9ba1e\r\nContent-Disposition: form-data; name=\"file\"; filename=\"homex.gcode\"\r\nContent-Type: application/octet-stream\r\n\r\nG28 X\n\r\n--a19568a4e7304093bb9b7d0246f9ba1e--\r\n"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"376"
|
||||
],
|
||||
"Content-Type": [
|
||||
"multipart/form-data; boundary=a19568a4e7304093bb9b7d0246f9ba1e"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne63g.byk8IKEzbAYmD6rrywDI3Uu0quY"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"done\": true, \n \"files\": {\n \"local\": {\n \"name\": \"homex.gcode\", \n \"origin\": \"local\", \n \"refs\": {\n \"download\": \"http://printer15.local/downloads/files/local/homex.gcode\", \n \"resource\": \"http://printer15.local/api/files/local/homex.gcode\"\n }\n }\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"292"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Location": [
|
||||
"http://printer15.local/api/files/local/homex.gcode"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne64Q.q5JCiObvtXxJMyC5gGEEbYAQCgQ; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 201,
|
||||
"message": "CREATED"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:46",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"select\", \"print\": true}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"36"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne64Q.q5JCiObvtXxJMyC5gGEEbYAQCgQ"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne64g.WvlFo3vPUJLopETogQYZ8bZ7MEw; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:47",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"pause\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"20"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne64g.WvlFo3vPUJLopETogQYZ8bZ7MEw"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne64w.gzSgliyJvAPdp6V4WzBOw17KfTQ; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:48",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": "{\"command\": \"restart\"}"
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"22"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne64w.gzSgliyJvAPdp6V4WzBOw17KfTQ"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "POST",
|
||||
"uri": "http://printer15.local/api/job"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne65A.AcvUhZPhMf0z9WwDBpJ4EAihXFI; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/job"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:49",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne65A.AcvUhZPhMf0z9WwDBpJ4EAihXFI"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/api/connection"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": null,
|
||||
"string": "{\n \"current\": {\n \"baudrate\": 115200, \n \"port\": \"/dev/ttyACM0\", \n \"printerProfile\": \"_default\", \n \"state\": \"Printing\"\n }, \n \"options\": {\n \"baudratePreference\": 115200, \n \"baudrates\": [\n 115200, \n 250000, \n 230400, \n 57600, \n 38400, \n 19200, \n 9600\n ], \n \"portPreference\": \"/dev/ttyACM0\", \n \"ports\": [\n \"/dev/ttyACM0\"\n ], \n \"printerProfilePreference\": \"_default\", \n \"printerProfiles\": [\n {\n \"id\": \"_default\", \n \"name\": \"Default\"\n }\n ]\n }\n}"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"544"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne65Q.7mkhrzVcqH5xQeNN5Nlv5JBrAt4; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/api/connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"recorded_at": "2016-07-25T14:59:57",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne65Q.7mkhrzVcqH5xQeNN5Nlv5JBrAt4"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.10.0"
|
||||
],
|
||||
"X-Api-Key": [
|
||||
"YouShallNotPass"
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"uri": "http://printer15.local/api/files/local/homex.gcode"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Content-Length": [
|
||||
"0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"text/html; charset=utf-8"
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.1"
|
||||
],
|
||||
"Set-Cookie": [
|
||||
"session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSigpJNvRziTT1DY_K9XPxy_ELca30dXHLigoJyvHLysiOCvc18jUKNYoMcbRVqtVRykxJzSvJLKnUSywtyYgvqSxIVbLKK83JQZJBMj3CyK08MdAWrLO0OLUoHqtcLQB_4zOk.Cne67Q.pT3b9_-vIWyJRk8Mc-k6Nf99Zjc; Path=/; HttpOnly"
|
||||
],
|
||||
"X-Clacks-Overhead": [
|
||||
"GNU Terry Pratchett"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 204,
|
||||
"message": "NO CONTENT"
|
||||
},
|
||||
"url": "http://printer15.local/api/files/local/homex.gcode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.7.1"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"http_interactions": [],
|
||||
"recorded_with": "betamax/0.8.0"
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
"http_interactions": [
|
||||
{
|
||||
"recorded_at": "2017-06-19T10:36:45",
|
||||
"request": {
|
||||
"body": {
|
||||
"encoding": "utf-8",
|
||||
"string": ""
|
||||
},
|
||||
"headers": {
|
||||
"Accept": [
|
||||
"*/*"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"User-Agent": [
|
||||
"python-requests/2.18.1"
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"uri": "http://printer15.local/sockjs/info"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"encoding": "UTF-8",
|
||||
"string": "{\"entropy\":52339962,\"websocket\":true,\"origins\":[\"*:*\"],\"cookie_needed\":true}"
|
||||
},
|
||||
"headers": {
|
||||
"Access-Control-Allow-Credentials": [
|
||||
"true"
|
||||
],
|
||||
"Access-Control-Allow-Origin": [
|
||||
"*"
|
||||
],
|
||||
"Cache-Control": [
|
||||
"no-store, no-cache, must-revalidate, max-age=0"
|
||||
],
|
||||
"Content-Length": [
|
||||
"76"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=UTF-8"
|
||||
],
|
||||
"Date": [
|
||||
"Mon, 19 Jun 2017 10:36:45 GMT"
|
||||
],
|
||||
"Etag": [
|
||||
"\"420ca7534b1993fe2192d744b69f1915c7887ed8\""
|
||||
],
|
||||
"Server": [
|
||||
"TornadoServer/4.0.2"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"url": "http://printer15.local/sockjs/info"
|
||||
}
|
||||
}
|
||||
],
|
||||
"recorded_with": "betamax/0.8.0"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"http_interactions": [],
|
||||
"recorded_with": "betamax/0.8.0"
|
||||
}
|
File diff suppressed because one or more lines are too long
562
projects/octorest/test/test_client.py
Normal file
562
projects/octorest/test/test_client.py
Normal file
|
@ -0,0 +1,562 @@
|
|||
import time
|
||||
import os
|
||||
from itertools import chain, combinations
|
||||
|
||||
import pytest
|
||||
import os
|
||||
|
||||
from octorest import OctoRest
|
||||
|
||||
from betamax import Betamax
|
||||
from betamax_serializers import pretty_json
|
||||
|
||||
from _common import URL, APIKEY
|
||||
|
||||
with Betamax.configure() as config:
|
||||
config.cassette_library_dir = 'tests/fixtures/cassettes'
|
||||
record_mode = os.environ.get('RECORD', 'none')
|
||||
config.default_cassette_options['record_mode'] = record_mode
|
||||
config.default_cassette_options['match_requests_on'] = {
|
||||
'uri',
|
||||
'method',
|
||||
}
|
||||
Betamax.register_serializer(pretty_json.PrettyJSONSerializer)
|
||||
config.default_cassette_options['serialize_with'] = 'prettyjson'
|
||||
|
||||
|
||||
def sleep(seconds):
|
||||
'''
|
||||
If recording, sleep for a given amount of seconds
|
||||
'''
|
||||
# if 'RECORD' in os.environ:
|
||||
time.sleep(seconds)
|
||||
|
||||
|
||||
def cmd_wait(client, state):
|
||||
while client.state() == state:
|
||||
sleep(0.1)
|
||||
|
||||
|
||||
def cmd_wait_until(client, state):
|
||||
while client.state() != state:
|
||||
sleep(0.1)
|
||||
|
||||
|
||||
def subsets(*items):
|
||||
'''
|
||||
Get all possible subsets of something
|
||||
'''
|
||||
N = len(items)+1
|
||||
return chain(*map(lambda x: combinations(items, x), range(0, N)))
|
||||
|
||||
|
||||
def zero(component):
|
||||
'''
|
||||
Add a 0 at the end of the component, if it is tool
|
||||
'''
|
||||
return 'tool0' if component == 'tool' else component
|
||||
|
||||
|
||||
# @pytest.mark.usefixtures('betamax_session')
|
||||
@pytest.fixture
|
||||
def client():
|
||||
return OctoRest(url=URL, apikey=APIKEY, session=None)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def gcode():
|
||||
class GCode:
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
self.path = 'tests/fixtures/gcodes/{}'.format(filename)
|
||||
|
||||
return GCode('telephonebox.gcode')
|
||||
|
||||
|
||||
class TestClient:
|
||||
@pytest.mark.usefixtures('betamax_session')
|
||||
def test_init_works_with_good_auth(self):
|
||||
# Should not raise anything
|
||||
OctoRest(url=URL, apikey=APIKEY)
|
||||
|
||||
@pytest.mark.usefixtures('betamax_session')
|
||||
def test_init_raises_with_bad_auth(self):
|
||||
with pytest.raises(RuntimeError):
|
||||
OctoRest(url=URL, apikey='nope')
|
||||
|
||||
### VERSION INFORMATION TESTS ###
|
||||
|
||||
def test_version(self, client):
|
||||
version = client.get_version()
|
||||
assert 'api' in version
|
||||
assert 'server' in version
|
||||
assert 'text' in version
|
||||
|
||||
### FILE OPERATION TESTS ###
|
||||
|
||||
def test_files_contains_files_and_free_space_info(self, client):
|
||||
files = client.files()
|
||||
assert 'bigben.gcode' in [f['name'] for f in files['files']]
|
||||
assert isinstance(files['free'], int)
|
||||
|
||||
def test_files_local_works(self, client):
|
||||
files = client.files('local')
|
||||
assert 'bigben.gcode' in [f['name'] for f in files['files']]
|
||||
assert isinstance(files['free'], int)
|
||||
|
||||
def test_files_sdcard_works(self, client):
|
||||
files = client.files('sdcard')
|
||||
assert files['files'] == [] # no files on sdcard
|
||||
assert 'free' not in files # API doesn't report that back
|
||||
|
||||
@pytest.mark.parametrize('filename', ('bigben.gcode', 'stpauls.gcode'))
|
||||
def test_info_for_specific_file(self, client, filename):
|
||||
f = client.files(filename)
|
||||
assert f['name'] == filename
|
||||
|
||||
@pytest.mark.parametrize('filename', ('unicorn.gcode', 'yeti.gcode', 'noexist.gcode'))
|
||||
def test_nonexisting_file_raises(self, client, filename):
|
||||
with pytest.raises(RuntimeError):
|
||||
client.files(filename)
|
||||
|
||||
def test_upload_by_path(self, client, gcode):
|
||||
f = client.upload(gcode.path)
|
||||
assert f['done']
|
||||
assert f['files']['local']['name'] == gcode.filename
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_file_object(self, client, gcode):
|
||||
with open(gcode.path) as fo:
|
||||
f = client.upload(('fake.gcode', fo))
|
||||
assert f['done']
|
||||
assert f['files']['local']['name'] == 'fake.gcode'
|
||||
client.delete('fake.gcode')
|
||||
|
||||
def test_upload_and_select(self, client, gcode):
|
||||
f = client.upload(gcode.path, select=True)
|
||||
assert f['done']
|
||||
assert f['files']['local']['name'] == gcode.filename
|
||||
selected = client.job_info()['job']['file']['name']
|
||||
assert selected == gcode.filename
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_and_print(self, client, gcode):
|
||||
f = client.upload(gcode.path, print=True)
|
||||
sleep(1)
|
||||
assert f['done']
|
||||
assert f['files']['local']['name'] == gcode.filename
|
||||
selected = client.job_info()['job']['file']['name']
|
||||
assert selected == gcode.filename
|
||||
assert client.state() == 'Printing'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_and_select_one_by_one(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename)
|
||||
selected = client.job_info()['job']['file']['name']
|
||||
assert selected == gcode.filename
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_and_select_with_print_one_by_one(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename, print=True)
|
||||
sleep(1)
|
||||
selected = client.job_info()['job']['file']['name']
|
||||
assert selected == gcode.filename
|
||||
assert client.state() == 'Printing'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_and_select_and_print_one_by_one(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename)
|
||||
selected = client.job_info()['job']['file']['name']
|
||||
assert selected == gcode.filename
|
||||
client.start()
|
||||
sleep(1)
|
||||
assert client.state() == 'Printing'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_file_copy(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.copy(gcode.filename, 'copied.gcode')
|
||||
files = client.files()
|
||||
assert gcode.filename in [f['name'] for f in files['files']]
|
||||
assert 'copied.gcode' in [f['name'] for f in files['files']]
|
||||
client.delete(gcode.filename)
|
||||
client.delete('copied.gcode')
|
||||
|
||||
def test_file_copy_exists(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.copy(gcode.filename, 'copied.gcode')
|
||||
files = client.files()
|
||||
assert gcode.filename in [f['name'] for f in files['files']]
|
||||
assert 'copied.gcode' in [f['name'] for f in files['files']]
|
||||
with pytest.raises(RuntimeError):
|
||||
client.copy(gcode.filename, 'copied.gcode')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_file_copy_folder_not_exist(self, client, gcode):
|
||||
files = client.files()
|
||||
if 'copied.gcode' in [f['name'] for f in files['files']]:
|
||||
client.delete('copied.gcode')
|
||||
client.upload(gcode.path)
|
||||
with pytest.raises(RuntimeError):
|
||||
client.copy(gcode.filename, '/random/path/copied.gcode')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_file_move(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.move(gcode.filename, 'moved.gcode')
|
||||
files = client.files()
|
||||
assert 'moved.gcode' in [f['name'] for f in files['files']]
|
||||
client.delete('moved.gcode')
|
||||
|
||||
def test_file_move_exists(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.move(gcode.filename, 'moved.gcode')
|
||||
files = client.files()
|
||||
assert 'moved.gcode' in [f['name'] for f in files['files']]
|
||||
client.upload(gcode.path)
|
||||
with pytest.raises(RuntimeError):
|
||||
client.move(gcode.filename, 'moved.gcode')
|
||||
client.delete(gcode.filename)
|
||||
client.delete('moved.gcode')
|
||||
|
||||
def test_file_move_folder_not_exist(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
with pytest.raises(RuntimeError):
|
||||
client.copy(gcode.filename, '/random/path/moved.gcode')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_slice_curalegacy(self, client):
|
||||
client.slice('biscuithelper.STL', slicer='curalegacy')
|
||||
sleep(2)
|
||||
files = client.files()
|
||||
assert 'biscuithelper.gco' in [f['name'] for f in files['files']]
|
||||
client.delete('biscuithelper.gco')
|
||||
|
||||
@pytest.mark.parametrize('name', ('biscuits.gco', 'richtea.gcode'))
|
||||
def test_slice_curalegacy_gcode(self, client, name):
|
||||
client.slice('biscuithelper.STL', slicer='curalegacy', gcode=name)
|
||||
sleep(2)
|
||||
files = client.files()
|
||||
assert name in [f['name'] for f in files['files']]
|
||||
client.delete(name)
|
||||
|
||||
def test_slice_curalegacy_select(self, client):
|
||||
client.slice('biscuithelper.STL', slicer='curalegacy', select=True)
|
||||
sleep(2)
|
||||
files = client.files()
|
||||
assert 'biscuithelper.gco' in [f['name'] for f in files['files']]
|
||||
selected = client.job_info()['job']['file']['name']
|
||||
assert selected == 'biscuithelper.gco'
|
||||
client.delete('biscuithelper.gco')
|
||||
|
||||
def test_upload_print_pause_cancel(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename, print=True)
|
||||
cmd_wait_until(client, 'Printing')
|
||||
client.pause()
|
||||
cmd_wait(client, 'Pausing')
|
||||
assert client.state() == 'Paused'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_print_pause_restart(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename, print=True)
|
||||
cmd_wait_until(client, 'Printing')
|
||||
client.pause()
|
||||
cmd_wait_until(client, 'Paused')
|
||||
assert client.state() == 'Paused'
|
||||
client.restart()
|
||||
cmd_wait_until(client, 'Printing')
|
||||
assert client.state() == 'Printing'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_print_pause_resume(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename, print=True)
|
||||
cmd_wait_until(client, 'Printing')
|
||||
client.pause()
|
||||
cmd_wait_until(client, 'Paused')
|
||||
assert client.state() == 'Paused'
|
||||
client.resume()
|
||||
cmd_wait_until(client, 'Printing')
|
||||
assert client.state() == 'Printing'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_print_toggle(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename, print=True)
|
||||
cmd_wait_until(client, 'Printing')
|
||||
client.toggle()
|
||||
cmd_wait_until(client, 'Paused')
|
||||
assert client.state() == 'Paused'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_upload_print_toggle_toggle(self, client, gcode):
|
||||
client.upload(gcode.path)
|
||||
client.select(gcode.filename, print=True)
|
||||
cmd_wait_until(client, 'Printing')
|
||||
client.toggle()
|
||||
cmd_wait_until(client, 'Paused')
|
||||
assert client.state() == 'Paused'
|
||||
client.toggle()
|
||||
cmd_wait_until(client, 'Printing')
|
||||
assert client.state() == 'Printing'
|
||||
client.cancel()
|
||||
cmd_wait(client, 'Cancelling')
|
||||
client.delete(gcode.filename)
|
||||
|
||||
def test_logs(self, client):
|
||||
logs = client.logs()
|
||||
assert 'files' in logs
|
||||
assert 'free' in logs
|
||||
assert isinstance(logs['free'], int)
|
||||
|
||||
def test_delete_log(self, client):
|
||||
logs = client.logs()
|
||||
log_lst = [log['name'] for log in logs['files']]
|
||||
assert log_lst[0] in log_lst
|
||||
client.delete_log(log_lst[0])
|
||||
logs = client.logs()
|
||||
for log in logs['files']:
|
||||
assert log['name'] != log_lst[0]
|
||||
|
||||
def test_printer(self, client):
|
||||
printer = client.printer()
|
||||
assert 'ready' in printer['sd']
|
||||
assert printer['state']['flags']['operational']
|
||||
assert printer['state']['flags']['ready']
|
||||
assert not printer['state']['flags']['error']
|
||||
assert not printer['state']['flags']['printing']
|
||||
|
||||
def test_printer_temps(self, client):
|
||||
printer = client.printer()
|
||||
cmd_wait_until(client, 'Operational')
|
||||
assert 'bed' in printer['temperature']
|
||||
assert 'tool0' in printer['temperature']
|
||||
assert 'history' not in printer['temperature']
|
||||
|
||||
@pytest.mark.parametrize('exclude', subsets('sd', 'temperature', 'state'))
|
||||
def test_printer_with_excluded_stuff(self, client, exclude):
|
||||
printer = client.printer(exclude=exclude)
|
||||
for key in exclude:
|
||||
assert key not in printer
|
||||
assert len(printer) == 3 - len(exclude)
|
||||
|
||||
def test_printer_with_history(self, client):
|
||||
printer = client.printer(history=True)
|
||||
assert isinstance(printer['temperature']['history'], list)
|
||||
|
||||
@pytest.mark.parametrize('limit', range(1, 4))
|
||||
def test_printer_with_history_and_limit(self, client, limit):
|
||||
printer = client.printer(history=True, limit=limit)
|
||||
assert len(printer['temperature']['history']) == limit
|
||||
|
||||
@pytest.mark.parametrize('key', ('actual', 'target', 'offset'))
|
||||
@pytest.mark.parametrize('component', ('tool', 'bed'))
|
||||
def test_tool_and_bed(self, client, key, component):
|
||||
info = getattr(client, component)() # client.tool() or bed()
|
||||
assert 'history' not in info
|
||||
assert isinstance(info[zero(component)][key], (float, int))
|
||||
|
||||
# @pytest.mark.parametrize('key', ('actual', 'target'))
|
||||
# @pytest.mark.parametrize('component', ('tool', 'bed'))
|
||||
# def test_tool_and_bed_with_history(self, client, key, component):
|
||||
# # TODO: history is not working with bed or tool, only printer
|
||||
# info = getattr(client, component)(history=True)
|
||||
# assert 'history' in info
|
||||
# for h in info['history']:
|
||||
# assert isinstance(h[zero(component)][key], (float, int))
|
||||
|
||||
# @pytest.mark.parametrize('limit', range(1, 4))
|
||||
# @pytest.mark.parametrize('component', ('tool', 'bed'))
|
||||
# def test_tool_and_bed_with_history_limit(self, client, limit, component):
|
||||
# # TODO: history is not working with bed or tool, only printer
|
||||
# info = getattr(client, component)(history=True, limit=limit)
|
||||
# assert len(info['history']) == limit
|
||||
|
||||
def test_home_all(self, client):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.home()
|
||||
|
||||
@pytest.mark.parametrize('axes', (('x',), ('y',), ('z',), ('x', 'y',)))
|
||||
def test_home_some(self, client, axes):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.home(axes)
|
||||
|
||||
@pytest.mark.parametrize('coordinates', ((20, 0, 0), (0, 20, 0)))
|
||||
def test_jog(self, client, coordinates):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.jog(*coordinates)
|
||||
|
||||
@pytest.mark.parametrize('factor', (100, 50, 150, 0.5, 1.0))
|
||||
def test_feedrate(self, client, factor):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.feedrate(factor)
|
||||
|
||||
@pytest.mark.parametrize('how', (200, [200], {'tool0': 200}))
|
||||
def test_set_tool_temperature_to_200(self, client, how):
|
||||
client.tool_target(how)
|
||||
tool = client.tool()
|
||||
assert tool['tool0']['target'] == 200.0
|
||||
if 'RECORD' in os.environ:
|
||||
# Betamax had some problems here
|
||||
# And we don't do this for testing, but only with actual printer
|
||||
client.tool_target(0)
|
||||
|
||||
# @pytest.mark.parametrize('how', (20, [20], {'tool0': 20}))
|
||||
# def test_set_tool_offset_to_20(self, client, how):
|
||||
# client.tool_offset(how)
|
||||
# tool = client.tool()
|
||||
# print(tool)
|
||||
# assert tool['tool0']['offset'] == 20.0
|
||||
# # TODO: make the above assert work?
|
||||
# if 'RECORD' in os.environ:
|
||||
# client.tool_offset(0)
|
||||
|
||||
def test_selecting_tool(self, client):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.tool_select(0)
|
||||
|
||||
def test_extruding(self, client):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.extrude(1)
|
||||
|
||||
def test_retracting(self, client):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.retract(1)
|
||||
|
||||
@pytest.mark.parametrize('factor', (100, 75, 125, 0.75, 1.0))
|
||||
def test_flowrate(self, client, factor):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.flowrate(factor)
|
||||
|
||||
def test_set_bed_temperature_to_100(self, client):
|
||||
client.bed_target(100)
|
||||
bed = client.bed()
|
||||
assert bed['bed']['target'] == 100.0
|
||||
if 'RECORD' in os.environ:
|
||||
client.bed_target(0)
|
||||
|
||||
def test_set_bed_offset_to_10(self, client):
|
||||
client.bed_offset(10)
|
||||
bed = client.bed()
|
||||
assert bed['bed']['offset'] == 10.0
|
||||
if 'RECORD' in os.environ:
|
||||
client.bed_offset(0)
|
||||
|
||||
def test_sd_card_init(self, client):
|
||||
client.sd_init()
|
||||
|
||||
def test_sd_card_refresh(self, client):
|
||||
client.sd_refresh()
|
||||
|
||||
def test_sd_card_release(self, client):
|
||||
client.sd_release()
|
||||
|
||||
def test_sd_card_status(self, client):
|
||||
sd = client.sd()
|
||||
# no SD card here, so always not ready
|
||||
assert sd['ready'] is False
|
||||
|
||||
def test_single_gcode_command(self, client):
|
||||
client.gcode('G28 X')
|
||||
|
||||
def test_multiple_gcode_commands_nl(self, client):
|
||||
client.gcode('G28 X\nG28 Y')
|
||||
|
||||
def test_multiple_gcode_commands_list(self, client):
|
||||
client.gcode(['G28 X', 'G28 Y'])
|
||||
|
||||
def test_get_settings(self, client):
|
||||
settings = client.settings()
|
||||
assert 'api' in settings
|
||||
assert 'appearance' in settings
|
||||
|
||||
def test_unchanged_settings(self, client):
|
||||
settings = client.settings()
|
||||
new_settings = client.settings({})
|
||||
assert settings['api'] == new_settings['api']
|
||||
assert settings['appearance'] == new_settings['appearance']
|
||||
|
||||
def test_change_settings(self, client):
|
||||
settings = client.settings()
|
||||
printer_name = settings['appearance']['name']
|
||||
test_name = {'appearance': {'name': 'Gandalf'}}
|
||||
new_settings = client.settings(test_name)
|
||||
assert new_settings['appearance']['name'] == 'Gandalf'
|
||||
client.settings({'appearance': {'name': printer_name}})
|
||||
|
||||
# def test_tmp_session_key(self, client):
|
||||
# key = client.tmp_session_key()
|
||||
# print(key)
|
||||
|
||||
def test_users(self, client):
|
||||
users = client.users()
|
||||
assert 'users' in users
|
||||
|
||||
### CONNECTION HANDLING TESTS ###
|
||||
|
||||
def test_connection_info(self, client):
|
||||
info = client.connection_info()
|
||||
|
||||
assert 'current' in info
|
||||
assert 'baudrate' in info['current']
|
||||
assert 'port' in info['current']
|
||||
assert 'state' in info['current']
|
||||
|
||||
assert 'options' in info
|
||||
assert 'baudrates' in info['options']
|
||||
assert 'ports' in info['options']
|
||||
|
||||
def test_fake_ack(self, client):
|
||||
# we are only testing if no exception occurred, there's no return
|
||||
client.fake_ack()
|
||||
|
||||
def test_disconnect(self, client):
|
||||
client.disconnect()
|
||||
assert client.state() in ['Offline', 'Closed']
|
||||
|
||||
def test_connect(self, client):
|
||||
'''
|
||||
Since it's hard with betamax fixture to check state() multiple times
|
||||
in one test, this test hopes test_disconnect() was called before it.
|
||||
It is not possible to run it without it in record mode.
|
||||
TODO: Fix this
|
||||
'''
|
||||
client.connect()
|
||||
cmd_wait(client, 'Detecting baudrate')
|
||||
assert client.state() in ['Connecting',
|
||||
'Operational',
|
||||
'Opening serial port']
|
||||
client.disconnect()
|
||||
assert client.state() in ['Offline', 'Closed']
|
||||
|
||||
|
||||
# import json
|
||||
# client = OctoRest(url=URL, apikey=APIKEY)
|
||||
# client.new_folder('hello')
|
||||
# f = client.files(recursive=False)
|
||||
# print(json.dumps(f, indent=4))
|
||||
# g = client.files(recursive=True)
|
||||
# print(json.dumps(f, indent=4))
|
||||
# print(f == g)
|
||||
# print(client.version)
|
||||
# client.gcode("M106")
|
||||
# client.gcode("M106 \n G28 X Y Z \n M107")
|
37
projects/octorest/test/test_xhrstreaming.py
Normal file
37
projects/octorest/test/test_xhrstreaming.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
import pytest
|
||||
|
||||
from octorest import XHRStreamingEventHandler
|
||||
|
||||
from _common import URL
|
||||
|
||||
|
||||
def on_message(api, message):
|
||||
api.message = message
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('betamax_recorder')
|
||||
@pytest.fixture
|
||||
def client(betamax_recorder):
|
||||
betamax_recorder.current_cassette.match_options.remove('uri')
|
||||
session = betamax_recorder.session
|
||||
return XHRStreamingEventHandler(url=URL,
|
||||
session=session,
|
||||
on_message=on_message)
|
||||
|
||||
|
||||
class TestXHRStreamingGenerator:
|
||||
@pytest.mark.usefixtures('betamax_session')
|
||||
def test_init_works(self, betamax_session):
|
||||
XHRStreamingEventHandler(url=URL, session=betamax_session)
|
||||
|
||||
@pytest.mark.xfail(reason="OctoPrint\'s tornado server returns 404")
|
||||
def test_send(self, client):
|
||||
r = client.send({"throttle": 10})
|
||||
assert r.status_code in [200, 204]
|
||||
|
||||
def test_run(self, client):
|
||||
client.run()
|
||||
assert client.thread.is_alive()
|
||||
client.wait()
|
||||
assert client.message.get("connected", None)
|
32
projects/octorest/test/test_xhrstreaminggenerator.py
Normal file
32
projects/octorest/test/test_xhrstreaminggenerator.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
import pytest
|
||||
|
||||
from octorest import XHRStreamingGenerator
|
||||
|
||||
from _common import URL
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('betamax_recorder')
|
||||
@pytest.fixture
|
||||
def client(betamax_recorder):
|
||||
betamax_recorder.current_cassette.match_options.remove('uri')
|
||||
session = betamax_recorder.session
|
||||
return XHRStreamingGenerator(url=URL, session=session)
|
||||
|
||||
|
||||
class TestXHRStreamingGenerator:
|
||||
@pytest.mark.usefixtures('betamax_session')
|
||||
def test_init_works(self, betamax_session):
|
||||
XHRStreamingGenerator(url=URL, session=betamax_session)
|
||||
|
||||
def test_info(self, client):
|
||||
response = client.info()
|
||||
assert response.get("websocket", None) is not None
|
||||
|
||||
@pytest.mark.xfail(reason="OctoPrints tornado server returns 404")
|
||||
def test_send(self, client):
|
||||
r = client.send({"throttle": 10})
|
||||
assert r.status_code in [200, 204]
|
||||
|
||||
def test_readloop(self, client):
|
||||
generator = client.read_loop()
|
||||
assert next(generator).get("connected", None)
|
Loading…
Reference in a new issue