/srv/irclogs.ubuntu.com/2015/07/13/#ubuntu-quality.txt

=== chihchun_afk is now known as chihchun
=== chihchun is now known as chihchun_afk
=== chihchun_afk is now known as chihchun
Saviqelopio, hi, it's your favourite I-bug-you, any idea how to get rid of \ in https://github.com/Saviq/nova-compute-lxd/pull/3/files#diff-c80fca5016bdd3c8916dac9e8ba9a9fcR52 ?15:11
SaviqI tried everything I could think of with (), but no go :/15:11
elopioSaviq: many patches, that smells like not-so-easy to test code.15:12
elopioSaviq: but, you can make a patch, and then start it15:12
elopioinstead of putting it inside the with statement.15:13
Saviqelopio, yeah i was considering that, but that works and am quite happy, the only problem is I've no idea how to wrap without \15:13
elopioSaviq: well, \ is not wrong.15:13
Saviqelopio, sure, was just wondering if there's a solution :)15:14
Saviqelopio, fwiw, here's the tested function https://github.com/Saviq/nova-compute-lxd/blob/travis/nclxd/nova/virt/lxd/container_config.py#L5015:14
Saviqthere's a lot of self.foo() calls, hence all the mocks...15:15
elopioSaviq: ok, give me some moments and I'll check it.15:15
SaviqI could move the patches a level up, tried to keep the test low level, though15:16
Saviqelopio, thank15:16
Saviqs15:16
=== chihchun is now known as chihchun_afk
elopioSaviq: sorry, long meeting and then forgot about you.16:47
elopioSaviq: why do you have to patch something like _init_container_config16:48
elopiodoesn't seem to be slow, or to have any side-effects16:48
elopioit's an internal method, so you probably shouldn't write a unit test for it, but check it's behaviour through the public method that calls it.16:50
elopioyes, too many mocks. That usually happens when you try to do full coverage, but don't follow tdd.16:54
elopioSaviq: I would recommend to split the tests. I use a trick that if I can't properly name the test, it's probably wrong.16:55
elopiowrite first a test that's named like: test_configure_container_with_negative_memory_must_not_limit_memory16:56
elopiothen write test_configure_container_with_positive_memory_must_limit_memory.16:57
elopiotry passing to those methods a flavor that causes the if mem >= 0 to be taken, and a flavor that doesn't. And then check the container_config returned.16:57
elopioafai can see, you shouldn't need a mock to test that.16:58
Saviqelopio, right, test for _init_container_config is probably overkill17:12
Saviqelopio, and yeah, unfortunately I'm sticking tests on all that post-factum17:12
Saviqmocking add_config probably doesn't make sense either, now I think of it17:16
elopioSaviq: appart from configure_container, the rest of the method seem internal to me.17:39
elopiomaybe ask why are they public?17:39
Saviqelopio, could be indeed, will check if they're even called anywhere et17:39
balloonsbunosera Letozaf_ !19:37
Letozaf_buonasera balloons :) howzit ?19:38
balloonsexcellente. I was just talking with Akiva about the AP plugin19:38
balloonsI was just thinking about those bugs you found.. do you mind filing them?19:38
Letozaf_balloons, I will, I was just fighting getting Thunderbird to work, but I will just now19:39
Letozaf_balloons, bug 147410819:50
balloonsbug #147410819:57
Letozaf_balloons, :-P forgot #19:59
balloonsLetozaf_, the bot doesn't love us today.. No linky or print20:00
Letozaf_balloons, :-)20:03
Letozaf_balloons, bug #1474117 and bug #147411920:29

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!