View test_pytest_sample_1.py
import pytest | |
class SampleMethod(): | |
def method_1(self): | |
print('method_1') | |
return 'method_1' | |
View unittest_sample4.py
import unittest | |
from unittest.mock import patch | |
from sample_method import SampleMethod | |
class TestSampleMethod(unittest.TestCase): | |
def setUp(self): | |
print('setUp') | |
self.sample = SampleMethod() |
View unittest_sample3.py
import unittest | |
from unittest.mock import patch | |
from sample_method import SampleMethod | |
class TestSampleMethod(unittest.TestCase): | |
def setUp(self): | |
print('setUp') | |
self.sample = SampleMethod() |
View sample_method.py
class SampleMethod(): | |
def method_1(self): | |
print('method_1') | |
return 'method_1' |
View unittest_sample2.py
import unittest | |
from unittest.mock import MagicMock | |
class SampleMethod(): | |
def method_1(self): | |
print('method_1') | |
return 'method_1' |
View unittest_sample_1.py
import unittest | |
class SampleMethod(): | |
def method_1(self): | |
print('method_1') | |
return 'method_1' | |
def method_2(self): |
View mytoggl.plist
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>mytoggl</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>sh</string> | |
<string>ワークディレクトリパス/toggl.sh</string> |
View notification_toggl_task.py
"""Togglの作業をslackに書き込む.""" | |
import requests | |
import json | |
# Slack hooks | |
SLACK_HOOKS_URL = '[slack hook url]' | |
TOGGL_API_TOKEN = '[toggle token]' | |
file_name = './toggl_history.txt' | |
View toggl.sh
cd /Users/username/toggl | |
. env/bin/activate | |
python3 notification_toggl_task.py |
View create_rss.py
import os | |
import pprint | |
from datetime import datetime, timedelta | |
import pytz | |
# https://pypi.python.org/pypi/feedgenerator | |
import feedgenerator | |
rss_max = 10 | |
base_url = 'http://kamekokamekame.net/' | |
root_path = 'source/' |
NewerOlder