*** tpb has joined #timvideos | 00:00 | |
*** Jahanzeb has quit IRC | 01:15 | |
*** CarlFK has joined #timvideos | 01:24 | |
*** Jahanzeb has joined #timvideos | 01:37 | |
*** Jahanzeb has quit IRC | 01:58 | |
*** hyades has quit IRC | 03:20 | |
*** hyades has joined #timvideos | 03:34 | |
*** mithro- has joined #timvideos | 03:37 | |
*** mithro- has quit IRC | 03:43 | |
*** hyades has quit IRC | 03:46 | |
*** mithro- has joined #timvideos | 03:55 | |
*** mithro- has quit IRC | 04:06 | |
*** shenki_ has joined #timvideos | 04:16 | |
*** CarlFK has quit IRC | 04:18 | |
*** shenki has quit IRC | 04:18 | |
*** CarlFK1 has joined #timvideos | 04:18 | |
*** hyades has joined #timvideos | 04:23 | |
*** mithro has joined #timvideos | 04:26 | |
*** mithro has quit IRC | 04:45 | |
*** mithro has joined #timvideos | 04:45 | |
*** mithro has quit IRC | 04:50 | |
*** mithro has joined #timvideos | 04:51 | |
*** mithro has quit IRC | 05:17 | |
*** mithro has joined #timvideos | 06:44 | |
hyades | mithro: meeting in sometime? | 07:14 |
---|---|---|
mithro | hyades, yes | 07:14 |
mithro | hyades, | 07:22 |
mithro | just looking through your latest round of code changes | 07:22 |
mithro | If you want the exception object | 07:22 |
mithro | You want to use | 07:22 |
mithro | except Exception as e: | 07:23 |
mithro | rather then pulling it out of exc_info | 07:23 |
mithro | hyades, you also want to group the getters and setters together | 07:23 |
mithro | IE the address setter and the address getter should be together | 07:24 |
hyades | ok | 07:24 |
hyades | of a property? | 07:24 |
mithro | yes | 07:24 |
mithro | Your also pull the domain out and then never using it | 07:25 |
mithro | I'm pretty sure Exception doesn't have a "domain" attribute | 07:25 |
mithro | your except class should be as specific as possible | 07:25 |
hyades | ok...i was seeing exc_info that from gi/_glib/option.py | 07:25 |
hyades | yeah domain has no use | 07:25 |
mithro | if I put a syntax error at line 127 in connection.py you'll get a connection error | 07:26 |
hyades | how? | 07:26 |
mithro | what do you mean how? | 07:27 |
hyades | this part right? | 07:27 |
hyades | connection = Gio.DBusConnection.new_for_address_sync( | 07:27 |
hyades | try: | 07:27 |
hyades | ohhh | 07:28 |
hyades | that was more of a typo | 07:28 |
hyades | it should be except GLib.GError | 07:29 |
hyades | i added it, maybe removed while testing | 07:29 |
mithro | hyades, in the call now | 07:30 |
hyades | give me 2 mins | 07:30 |
mithro | hyades, the mark/check face stuff shouldn't probably be throwing a ConnectionError? | 07:33 |
mithro | hyades, have to be quick today, I need to head to the airport in 30 minutes | 07:34 |
*** hyades_ has joined #timvideos | 07:38 | |
mithro | <mithro> hyades, have to be quick today, I need to head to the airport in 30 minutes | 07:38 |
hyades_ | im in | 07:38 |
mithro | hyades, try dragging the bandwidth slider all the way down | 07:40 |
hyades_ | some problems | 07:40 |
hyades_ | connectivity | 07:40 |
hyades_ | ill try | 07:40 |
hyades_ | its full! | 07:41 |
mithro | https://pypi.python.org/pypi/pytest-cov | 07:47 |
tpb | Title: pytest-cov 1.6 : Python Package Index (at pypi.python.org) | 07:47 |
mithro | hyades, poke? | 07:49 |
hyades_ | im thr | 07:50 |
hyades_ | i can hear u | 07:50 |
hyades_ | mithro, | 07:50 |
mithro | hyades, switch to text | 07:50 |
mithro | hyades, do you have any questions about the upcoming mid-term evaluation? | 07:51 |
*** hyades__ has joined #timvideos | 07:51 | |
hyades__ | mithro, | 07:51 |
mithro | <mithro> hyades, switch to text | 07:51 |
mithro | <mithro> hyades, do you have any questions about the upcoming mid-term evaluation? | 07:51 |
hyades__ | anything apart from blog post? | 07:52 |
hyades__ | like any target? | 07:52 |
mithro | so where do you think should be finished by then? | 07:52 |
hyades__ | where? | 07:53 |
hyades__ | didnt get you | 07:53 |
*** hyades is now known as Guest83695 | 07:53 | |
*** hyades__ is now known as hyades | 07:53 | |
hyades | also a bit of functionality of the code.. | 07:54 |
mithro | hyades, what do you want to have finished by the mid-term? | 07:54 |
hyades | its like in another 10 days | 07:55 |
mithro | yes | 07:55 |
hyades | so can say most of exception handling | 07:55 |
*** hyades_ has quit IRC | 07:55 | |
hyades | unittests i am not sure | 07:55 |
mithro | hyades, btw pytest-coverage https://pypi.python.org/pypi/pytest-cov | 07:55 |
tpb | Title: pytest-cov 1.6 : Python Package Index (at pypi.python.org) | 07:55 |
hyades | yeah fine, i will use it | 07:55 |
mithro | hyades, so what functionality do you have now? | 07:56 |
hyades | 1) The server processes | 07:57 |
hyades | 2) Test inputs | 07:57 |
hyades | 3) Dbus remote method calls (not tested) | 07:57 |
hyades | 4) Preview outputs | 07:57 |
hyades | these four | 07:58 |
hyades | in a broad sense | 07:58 |
hyades | mithro, ping? | 08:01 |
mithro | okay | 08:02 |
mithro | so you need to show how your tests are working | 08:03 |
hyades | coverage should be 100%? | 08:03 |
mithro | for unittests | 08:03 |
mithro | hyades, you should also have integration tests | 08:04 |
hyades | till mid-term? | 08:04 |
mithro | s/till/before/ | 08:04 |
hyades | i cannot do unittests if Exception handling is not done.. | 08:05 |
mithro | hyades, probably | 08:06 |
hyades | i am not sure both and integration tests can be done till mid-term | 08:06 |
hyades | i will mostly complete exception handling and unittests till then.. | 08:07 |
mithro | why? | 08:08 |
hyades | the unittests take time :/ | 08:08 |
mithro | I have to go | 08:08 |
mithro | you have 40 hours a week | 08:09 |
hyades | i will try adding | 08:09 |
hyades | i will ask you about integration tests later when i come to them .. | 08:09 |
hyades | mithro, anything else? | 08:12 |
*** mithro has quit IRC | 08:13 | |
*** hyades_ has joined #timvideos | 08:16 | |
*** hyades has quit IRC | 08:17 | |
*** hyades_ is now known as hyades | 08:37 | |
*** bananadine has joined #timvideos | 09:38 | |
bananadine | hey guys | 09:47 |
bananadine | where did mithro go? | 09:47 |
hyades | he had some flight | 10:06 |
bananadine | oh | 10:08 |
bananadine | we had a weekly meeting scheduled for now | 10:08 |
hyades | oh | 12:01 |
*** hyades has quit IRC | 12:05 | |
*** hyades has joined #timvideos | 12:49 | |
*** mithro has joined #timvideos | 13:05 | |
bananadine | hi mithro, we didn't have a vido chat today | 13:54 |
hyades | mithro, achieving 100% coverage is not possible | 14:02 |
hyades | i have exceptions like OSError for which I cannot design a test case | 14:02 |
CarlFK1 | hyades: I don't know if it is needed, but you can write code that raises an OSError - getting that code to run in place of say f=open(x) takes some work, but at least it is possible | 14:08 |
hyades | for these ones i have written test cases | 14:09 |
hyades | but some things like killing a process may raise a OSError | 14:09 |
hyades | for which I cannot have a test case | 14:09 |
CarlFK1 | um.. you can.. it is just work. | 14:10 |
CarlFK1 | here is how I override python's open function: https://github.com/CarlFK/veyepar/blob/master/dj/scripts/archive_uploader.py#L14 | 14:11 |
tpb | <http://ln-s.net/-YWl> (at github.com) | 14:11 |
CarlFK1 | not for testing, but I could do something similar | 14:11 |
CarlFK1 | where is your code that kills a process? | 14:12 |
hyades | https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/server.py#L195 | 14:13 |
tpb | <http://ln-s.net/-YWo> (at github.com) | 14:13 |
hyades | https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/server.py#L217 | 14:13 |
tpb | <http://ln-s.net/-YWs> (at github.com) | 14:13 |
hyades | even this | 14:15 |
hyades | https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/server.py#L163 | 14:15 |
tpb | <http://ln-s.net/-YWy> (at github.com) | 14:15 |
*** hyades has quit IRC | 14:31 | |
*** bananadine has quit IRC | 14:43 | |
*** hyades has joined #timvideos | 14:59 | |
*** hyades has joined #timvideos | 15:00 | |
*** CarlFK1 is now known as CarlFK | 15:00 | |
*** hyades_ has joined #timvideos | 15:16 | |
*** hyades has quit IRC | 15:18 | |
hyades_ | CarlFK, any solution? | 15:26 |
*** hyades_ is now known as hyades | 15:26 | |
CarlFK | hyades: http://bpaste.net/show/ekX6mkRqWS6ZzGobUDPd/ server.os.kill = fake_kill | 15:27 |
tpb | Title: Paste #ekX6mkRqWS6ZzGobUDPd at spacepaste (at bpaste.net) | 15:27 |
CarlFK | That's the first time I have coded such a thing, so I have no idea if that is the best way or not.. just shows it can be done | 15:28 |
hyades | ahh nice :) | 15:28 |
*** mithro has quit IRC | 15:51 | |
hyades | CarlFK, https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/test_server.py#L94 | 15:51 |
tpb | <http://ln-s.net/-Y_i> (at github.com) | 15:51 |
hyades | thanks for that hint | 15:51 |
CarlFK | yay :) | 15:53 |
*** hyades has quit IRC | 16:04 | |
*** hyades has joined #timvideos | 16:07 | |
*** Jahanzeb has joined #timvideos | 16:45 | |
*** Jahanzeb has quit IRC | 17:51 | |
*** micolous has quit IRC | 17:58 | |
*** hyades has quit IRC | 18:17 | |
*** hyades has joined #timvideos | 18:30 | |
*** hyades has quit IRC | 19:00 | |
*** hyades has joined #timvideos | 19:12 | |
*** hyades has quit IRC | 19:18 | |
*** hyades has joined #timvideos | 19:35 | |
*** hyades has quit IRC | 19:56 | |
*** hyades has joined #timvideos | 20:09 | |
hyades | CarlFK, unittests should not use any other modules of my code right? | 20:34 |
CarlFK | hyades: that sounds more like a goal than a rule | 20:36 |
hyades | CarlFK, https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/connection.py#L117 | 20:37 |
tpb | <http://ln-s.net/-Yiw> (at github.com) | 20:37 |
CarlFK | I think it depends on how well the code being tested is written - how isolated is each function | 20:37 |
hyades | here i make a connection | 20:37 |
hyades | but for making connection , i need a server | 20:38 |
hyades | running | 20:38 |
hyades | and later i call remote methods, for which i gain need server+connection | 20:38 |
hyades | s/gain/again | 20:39 |
CarlFK | so anther issue is figuring out what you do and don't need to test | 20:40 |
CarlFK | like you don't need to test that the TCP/IP stack in the OS works - we can just assume it does | 20:40 |
hyades | yeah.. | 20:41 |
CarlFK | Gio.DBusConnection.new_for_address_sync - someone else wrote that, you just call it, right? | 20:41 |
hyades | its present! | 20:41 |
hyades | i didnt write | 20:42 |
CarlFK | from gi.repository import Gio, GLib | 20:42 |
CarlFK | right .. so I think it is safe to assume it works | 20:43 |
hyades | so i test these in integration tests? | 20:43 |
CarlFK | and if it needs testing, it should have it's own test, not rely on gst-switch / python-api / gstswitch / connection.py | 20:43 |
CarlFK | I am putting it in the same category as the network stack | 20:43 |
hyades | ya similar | 20:43 |
hyades | it makes dbus connection etc. | 20:44 |
CarlFK | but you do need to test the code you wrote : def connect_dbus(self): | 20:44 |
CarlFK | you are calling new_for_address_sync with 4 parameters | 20:45 |
CarlFK | address, flags, none, none | 20:46 |
hyades | for that self.address has to be set to something meaning-full | 20:46 |
CarlFK | when you run a test, address and flags will always be the same, right ? | 20:46 |
hyades | if gst-switch-srv runs, it is "unix:abstract=gstswitch" | 20:47 |
CarlFK | thats the value of address ? | 20:47 |
hyades | yes | 20:48 |
CarlFK | what will the value for flags be ? | 20:48 |
hyades | and to test this, i need something at that address running | 20:48 |
hyades | its constant | 20:48 |
CarlFK | again, for a single test - you may need more than one test | 20:48 |
CarlFK | what will the value ? | 20:50 |
hyades | CONNECTION_FLAGS = Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT | 20:50 |
CarlFK | k | 20:51 |
CarlFK | so make a fake new_for_address_sync that takes 4 parameters | 20:51 |
hyades | k. | 20:52 |
CarlFK | like def new_for_address_sync( p1, p2, p3, p4 ) : | 20:52 |
*** Jahanzeb has joined #timvideos | 20:52 | |
CarlFK | if p1=="unix:abstract=gstswitch" and p2==Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT and p3 is none and p4 is none: return fake_connection() | 20:53 |
CarlFK | else: raise .. um.. BadTestParaeters or something | 20:53 |
CarlFK | Not even sure you need to bother checking | 20:53 |
CarlFK | return fake_connection() is the important part | 20:54 |
hyades | whr shud thiscode come in? | 20:55 |
CarlFK | it is part of the test, so wherever that code lives.. (i think) | 20:57 |
CarlFK | look this over https://pypi.python.org/pypi/mock | 20:57 |
tpb | Title: mock 1.0.1 : Python Package Index (at pypi.python.org) | 20:57 |
CarlFK | well, hold.. | 20:57 |
CarlFK | so you have some fake_connection() function that gets stored to self.connection | 20:58 |
CarlFK | lets back up a bit... | 20:59 |
hyades | ok | 20:59 |
CarlFK | to get full coverage, you need to test def connect_dbus(self): twice | 21:00 |
CarlFK | once that ... | 21:00 |
CarlFK | hole...oohe | 21:00 |
CarlFK | phone call | 21:02 |
* hyades can sleep off any time | 21:30 | |
CarlFK | abvout dome... | 21:41 |
*** hyades has quit IRC | 22:25 | |
*** Jahanzeb has quit IRC | 22:33 | |
*** Jahanzeb has joined #timvideos | 22:35 | |
*** CarlFK has quit IRC | 23:00 | |
*** parx has quit IRC | 23:12 | |
*** parx has joined #timvideos | 23:19 | |
*** CarlFK has joined #timvideos | 23:36 |
Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!